diff options
author | Alan Pearce | 2024-05-09 19:27:15 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:31:36 +0200 |
commit | 830e14f372fcff094448ac8528386ab381f6f35c (patch) | |
tree | dbc0082cfc7d0791f83edc5b8ba3c82773ec67d5 /internal/config | |
parent | c72f8dc787379f6544739c5c57a8241a14f6d2a0 (diff) | |
download | searchix-830e14f372fcff094448ac8528386ab381f6f35c.tar.lz searchix-830e14f372fcff094448ac8528386ab381f6f35c.tar.zst searchix-830e14f372fcff094448ac8528386ab381f6f35c.zip |
refactor: pass Source object to templates
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 5801847..e381e61 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -30,7 +30,7 @@ type Config struct { DataPath string `toml:"data-path"` CSP CSP `toml:"content-security-policy"` Headers map[string]string - Sources map[string]importer.Source + Sources map[string]*importer.Source } var defaultConfig = Config{ @@ -41,7 +41,7 @@ var defaultConfig = Config{ Headers: map[string]string{ "x-content-type-options": "nosniff", }, - Sources: map[string]importer.Source{ + Sources: map[string]*importer.Source{ "nixos": { Name: "NixOS", Enable: true, @@ -114,7 +114,7 @@ func GetConfig(filename string) (*Config, error) { } } - maps.DeleteFunc(config.Sources, func(_ string, v importer.Source) bool { + maps.DeleteFunc(config.Sources, func(_ string, v *importer.Source) bool { return !v.Enable }) |