all repos — searchix @ f24c5b0a9901cc91967ed83bc4a015bd0b2c3d4d

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

refactor: move Source type

Alan Pearce
commit

f24c5b0a9901cc91967ed83bc4a015bd0b2c3d4d

parent

df77930bef039e4aef024574c60fb64d75287eee

2 files changed, 16 insertions(+), 15 deletions(-)

jump to
M internal/importer/importer.gointernal/importer/importer.go
@@ -6,22 +6,7 @@ "log/slog"
"path" "searchix/internal/search" "sync" - "time" ) - -type Source struct { - Name string - Key string - Enable bool - Type Type - Channel string - Attribute string - ImportPath string `toml:"import-path"` - FetchTimeout time.Duration `toml:"fetch-timeout"` - ImportTimeout time.Duration `toml:"import-timeout"` - OutputPath string `toml:"output-path"` - Repo Repository -} type Importer interface { FetchIfNeeded(context.Context) (bool, error)
M internal/importer/source-type.gointernal/importer/source-type.go
@@ -2,6 +2,7 @@ package importer
import ( "fmt" + "time" "github.com/stoewer/go-strcase" )
@@ -42,3 +43,18 @@ *f, err = parseType(string(text))
return err } + +type Source struct { + Name string + Key string + Enable bool + Type Type + Channel string + URL string + Attribute string + ImportPath string `toml:"import-path"` + FetchTimeout time.Duration `toml:"fetch-timeout"` + ImportTimeout time.Duration `toml:"import-timeout"` + OutputPath string `toml:"output-path"` + Repo Repository +}