From be389b35ce6364deb6533d6267545905d6fd8ba1 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/opensearch/opensearch.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 internal/opensearch/opensearch.go (limited to 'internal/opensearch/opensearch.go') diff --git a/internal/opensearch/opensearch.go b/internal/opensearch/opensearch.go new file mode 100644 index 0000000..a9b3c9c --- /dev/null +++ b/internal/opensearch/opensearch.go @@ -0,0 +1,21 @@ +package opensearch + +import ( + "encoding/xml" + "searchix/internal/config" +) + +type Description struct { + XMLName xml.Name `xml:"http://a9.com/-/spec/opensearch/1.1/ OpenSearchDescription"` + Description string + LongName string + ShortName string + SearchForm *config.URL `xml:"http://www.mozilla.org/2006/browser/search/ SearchForm"` + URL URL `xml:"Url"` +} + +type URL struct { + Method string `xml:"method,attr"` + Template *config.URL `xml:"template,attr"` + Type string `xml:"type,attr"` +} -- cgit 1.4.1