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/structs.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/structs.go')
-rw-r--r-- | internal/config/structs.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/config/structs.go b/internal/config/structs.go index 6c6bc13..e6cf20b 100644 --- a/internal/config/structs.go +++ b/internal/config/structs.go @@ -4,6 +4,7 @@ package config // keep config structs here so that lll ignores the long lines (go doesn't support multi-line struct tags) import ( + "fmt" "log/slog" ) @@ -47,3 +48,14 @@ type Source struct { OutputPath string `comment:"(Fetcher=channel) Path under ./result symlink to folder containing {options,packages}.json."` Repo Repository `comment:"Used to generate declaration/definition links"` } + +func (source *Source) String() string { + switch source.Importer { + case Options: + return source.Name + " " + source.Importer.String() + case Packages: + return source.Name + default: + return fmt.Sprintf("Source(%s)", source.Name) + } +} |