all repos — searchix @ 13c673dab5bd4e3a23c89304635034137fdbc78f

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

refactor: move interfaces closer to usage

Alan Pearce
commit

13c673dab5bd4e3a23c89304635034137fdbc78f

parent

40f7fe5cb75c254cf595b9ad50de6de99fd78c7b

1 file changed, 5 insertions(+), 6 deletions(-)

changed files
M internal/importer/package.gointernal/importer/package.go
@@ -12,6 +12,7 @@
"alin.ovh/x/log" "alin.ovh/searchix/internal/config" + "alin.ovh/searchix/internal/index" "alin.ovh/searchix/internal/nix" "alin.ovh/searchix/internal/programs"
@@ -73,7 +74,7 @@ infile io.ReadCloser,
source config.Source, log *log.Logger, programsDB *programs.DB, -) (*PackageIngester, error) { +) *PackageIngester { i := &PackageIngester{ dec: jstream.NewDecoder(infile, source.JSONDepth).EmitKV(), log: log,
@@ -90,13 +91,11 @@ Squash: true,
DecodeHook: mapstructure.TextUnmarshallerHookFunc(), }) if err != nil { - defer infile.Close() - - return nil, fault.Wrap(err, fmsg.With("could not create mapstructure decoder")) + panic("could not create mapstructure decoder: " + err.Error()) } i.ms = ms - return i, nil + return i } func convertToLicense(in map[string]any) *nix.License {
@@ -122,7 +121,7 @@ }
func (i *PackageIngester) Process( ctx context.Context, - results chan<- nix.Importable, + results chan<- index.Indexable, errs chan<- error, ) { if i.programs != nil {