This commit is contained in:
2024-11-18 16:28:45 +02:00
parent f0452ff9f7
commit 825c7e3391
34 changed files with 624 additions and 426 deletions

View File

@@ -34,7 +34,7 @@ func (u *URL) Scan(value interface{}) error {
return nil
}
func (u *URL) String() string {
func (u URL) String() string {
return u.Full
}
@@ -62,7 +62,8 @@ func ParseURL(input string, descr string) (*URL, error) {
if err != nil {
return nil, fmt.Errorf("%w: Input %s Error %w", ErrURLParse, input, err)
}
return &URL{Protocol: protocol, Hostname: hostname, Port: port, Path: path, Descr: descr, Full: u.String()}, nil
full := fmt.Sprintf("%s://%s:%d%s", protocol, hostname, port, path)
return &URL{Protocol: protocol, Hostname: hostname, Port: port, Path: path, Descr: descr, Full: full}, nil
}
//func GeminiUrltoJSON(g URL) string {