probo/store/file/collection.go

23 lines
754 B
Go
Raw Normal View History

package file
import (
"git.andreafazzi.eu/andrea/probo/models"
2023-11-13 21:01:12 +01:00
"git.andreafazzi.eu/andrea/probo/store"
)
type CollectionFileStore = FileStore[*models.Collection, *store.Store[*models.Collection]]
func NewCollectionFileStore(config *FileStoreConfig[*models.Collection, *store.CollectionStore]) (*CollectionFileStore, error) {
return NewFileStore[*models.Collection](config, store.NewStore[*models.Collection]())
}
2023-11-20 14:14:09 +01:00
func NewDefaultCollectionFileStore() (*CollectionFileStore, error) {
return NewCollectionFileStore(
&FileStoreConfig[*models.Collection, *store.CollectionStore]{
FilePathConfig: FilePathConfig{DefaultBaseDir, "collection", ".json"},
IndexDirFunc: DefaultIndexDirFunc[*models.Collection, *store.CollectionStore],
},
)
}