From 58a7fc78b8e17dc4ce009767afd9066bbaa9328f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 21 Jun 2024 15:35:23 +0200 Subject: refactor: use encoding/xml for OpenSearchDescription --- internal/config/config.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'internal/config/config.go') 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 } -- cgit 1.4.1