diff options
author | Alan Pearce | 2024-06-21 15:35:23 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-21 15:35:23 +0200 |
commit | be389b35ce6364deb6533d6267545905d6fd8ba1 (patch) | |
tree | 5cd380aa950304a0880984cdd81993167a057397 /internal/config/config.go | |
parent | fc5fd2edd9b8282497e33a18300eab694d8a89c6 (diff) | |
download | searchix-be389b35ce6364deb6533d6267545905d6fd8ba1.tar.lz searchix-be389b35ce6364deb6533d6267545905d6fd8ba1.tar.zst searchix-be389b35ce6364deb6533d6267545905d6fd8ba1.zip |
refactor: use encoding/xml for OpenSearchDescription
Diffstat (limited to 'internal/config/config.go')
-rw-r--r-- | internal/config/config.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 83ddd2c..14375d6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -31,6 +31,18 @@ func (u *URL) UnmarshalText(text []byte) (err error) { return nil } +func (u *URL) JoinPath(elems ...string) *URL { + return &URL{u.URL.JoinPath(elems...)} +} + +func (u *URL) AddQuery(key, value string) *URL { + q := u.URL.Query() + q.Add(key, value) + u.RawQuery = q.Encode() + + return u +} + type Duration struct { time.Duration } |