feat: store import timestamp on entities
5 files changed, 10 insertions(+), 1 deletion(-)
M internal/importer/options.go → internal/importer/options.go
@@ -4,6 +4,7 @@ import ( "context" "io" "reflect" + "time" "alin.ovh/x/log"@@ -180,6 +181,7 @@ Example: i.convertDocsValue(i.optJSON.Example), RelatedPackages: nix.Markdown(i.optJSON.RelatedPackages), Loc: i.optJSON.Loc, Type: i.optJSON.Type, + ImportedAt: time.Now(), } } }()
M internal/importer/package.go → internal/importer/package.go
@@ -7,6 +7,7 @@ "io" "net/url" "reflect" "strings" + "time" "alin.ovh/x/log"@@ -338,6 +339,7 @@ Licenses: licenses, Maintainers: maintainers, Definition: definition, Programs: programs, + ImportedAt: time.Now(), } } }()
M internal/index/index_meta.go → internal/index/index_meta.go
@@ -11,7 +11,7 @@ "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" ) -const CurrentSchemaVersion = 8 +const CurrentSchemaVersion = 9 type SourceMeta struct { IndexedAt time.Time
M internal/nix/option.go → internal/nix/option.go
@@ -2,6 +2,7 @@ package nix import ( "io" + "time" "github.com/Southclaws/fault" "github.com/yuin/goldmark"@@ -31,6 +32,7 @@ Example *Docs `json:",omitempty"` Loc []string RelatedPackages Markdown `json:",omitempty"` Type string + ImportedAt time.Time `storm:"index"` } func (Option) BleveType() string {
M internal/nix/package.go → internal/nix/package.go
@@ -1,5 +1,7 @@ package nix +import "time" + type Package struct { Name string Attribute string `storm:"id"`@@ -16,6 +18,7 @@ Maintainers []Maintainer PackageSet string Platforms []string Version string + ImportedAt time.Time `storm:"index"` } type License struct {