internal/nix/importable.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | package nix
import (
"encoding/gob"
"alin.ovh/searchix/internal/config"
)
type Importable interface {
ImporterType() string
BleveType() string
GetName() string
GetSource() string
}
func GetKey(i Importable) string {
return i.ImporterType() + "/" + i.GetSource() + "/" + i.GetName()
}
func MakeKey(source config.Source, id string) string {
return source.Importer.String() + "/" + source.Key + "/" + id
}
func init() {
gob.Register(Option{})
gob.Register(Package{})
}
|