about summary refs log tree commit diff stats
path: root/internal/opensearch/opensearch.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-21 15:35:23 +0200
committerAlan Pearce2024-06-21 15:35:23 +0200
commitbe389b35ce6364deb6533d6267545905d6fd8ba1 (patch)
tree5cd380aa950304a0880984cdd81993167a057397 /internal/opensearch/opensearch.go
parentfc5fd2edd9b8282497e33a18300eab694d8a89c6 (diff)
downloadsearchix-be389b35ce6364deb6533d6267545905d6fd8ba1.tar.lz
searchix-be389b35ce6364deb6533d6267545905d6fd8ba1.tar.zst
searchix-be389b35ce6364deb6533d6267545905d6fd8ba1.zip
refactor: use encoding/xml for OpenSearchDescription
Diffstat (limited to 'internal/opensearch/opensearch.go')
-rw-r--r--internal/opensearch/opensearch.go21
1 files changed, 21 insertions, 0 deletions
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"`
+}