From 052fce5bf2b1995fe45b88626e5342e61933d7cd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 23 May 2024 13:22:50 +0200 Subject: refactor: use a single value for per-source import timeouts --- internal/config/structs.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'internal/config/structs.go') diff --git a/internal/config/structs.go b/internal/config/structs.go index 4137261..a434698 100644 --- a/internal/config/structs.go +++ b/internal/config/structs.go @@ -33,17 +33,16 @@ type Importer struct { } type Source struct { - Name string `comment:"Human-readable name of source for generating links"` - Key string `comment:"Machine-readable name of source. Must be URL- and path-safe."` - Enable bool `comment:"Controls whether to show in the web interface and to run fetch/import jobs."` - Fetcher Fetcher `comment:"How to fetch options.json. One of 'channel', 'channel-nixpkgs' or 'download'."` - Importer ImporterType `comment:"Kind of data available from source. Currently supports 'packages' and 'options'."` - Channel string `comment:"(Fetcher=channel) Local name for channel, (Fetcher=channel-nixpkgs) Remote name of channel."` - URL string `comment:"(Fetcher=channel) Remote URL for channel, (Fetcher=download) Path containing files named 'revision' and 'options.json'."` - Attribute string `comment:"(Fetcher=channel) Nix attribute name (i.e. nix-build -A) that builds an {options,packages}.json"` - ImportPath string `comment:"(Fetcher=channel) Sub-path of imported channel which contains the attribute above, e.g. release.nix"` - FetchTimeout Duration `comment:"Abort fetch if it takes longer than this."` - ImportTimeout 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"` + Name string `comment:"Human-readable name of source for generating links"` + Key string `comment:"Machine-readable name of source. Must be URL- and path-safe."` + Enable bool `comment:"Controls whether to show in the web interface and to run fetch/import jobs."` + Fetcher Fetcher `comment:"How to fetch options.json. One of 'channel', 'channel-nixpkgs' or 'download'."` + Importer ImporterType `comment:"Kind of data available from source. Currently supports 'packages' and 'options'."` + Channel string `comment:"(Fetcher=channel) Local name for channel, (Fetcher=channel-nixpkgs) Remote name of channel."` + URL string `comment:"(Fetcher=channel) Remote URL for channel, (Fetcher=download) Path containing files named 'revision' and 'options.json'."` + Attribute string `comment:"(Fetcher=channel) Nix attribute name (i.e. nix-build -A) that builds an {options,packages}.json"` + ImportPath string `comment:"(Fetcher=channel) Sub-path of imported channel which contains the attribute above, e.g. release.nix"` + 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"` } -- cgit 1.4.1