all repos — searchix @ 58a7fc78b8e17dc4ce009767afd9066bbaa9328f

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor: use encoding/xml for OpenSearchDescription

Alan Pearce
commit

58a7fc78b8e17dc4ce009767afd9066bbaa9328f

parent

a1dfc548198a1326e71f1dd70303a5d3441f7a39

1 file changed, 12 insertions(+), 0 deletions(-)

changed files
M internal/config/structs.gointernal/config/structs.go
@@ -4,6 +4,7 @@
// 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 @@ Timeout Duration `comment:"Abort import if it takes longer than this."`
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) + } +}