22 lines
675 B
Go
22 lines
675 B
Go
package file
|
|
|
|
import (
|
|
"git.andreafazzi.eu/andrea/probo/models"
|
|
"git.andreafazzi.eu/andrea/probo/store"
|
|
)
|
|
|
|
type GroupFileStore = FileStore[*models.Group, *store.Store[*models.Group]]
|
|
|
|
func NewGroupFileStore(config *FileStoreConfig[*models.Group, *store.GroupStore]) (*GroupFileStore, error) {
|
|
return NewFileStore[*models.Group](config, store.NewStore[*models.Group]())
|
|
}
|
|
|
|
func NewDefaultGroupFileStore() (*GroupFileStore, error) {
|
|
return NewGroupFileStore(
|
|
&FileStoreConfig[*models.Group, *store.GroupStore]{
|
|
FilePathConfig: FilePathConfig{GetDefaultGroupsDir(), "group", ".csv"},
|
|
IndexDirFunc: DefaultIndexDirFunc[*models.Group, *store.GroupStore],
|
|
},
|
|
)
|
|
|
|
}
|