1234567891011121314151617181920212223242526 |
- package file
- import (
- "git.andreafazzi.eu/andrea/probo/models"
- "git.andreafazzi.eu/andrea/probo/store"
- )
- type ParticipantFileStore = FileStore[*models.Participant, *store.ParticipantStore]
- func NewParticipantFileStore(config *FileStoreConfig[*models.Participant, *store.ParticipantStore]) (*ParticipantFileStore, error) {
- return NewFileStore[*models.Participant, *store.ParticipantStore](config, store.NewParticipantStore())
- }
- func NewParticipantDefaultFileStore() (*ParticipantFileStore, error) {
- return NewParticipantFileStore(
- &FileStoreConfig[*models.Participant, *store.ParticipantStore]{
- FilePathConfig: FilePathConfig{GetDefaultParticipantsDir(), "participant", ".json"},
- IndexDirFunc: DefaultIndexDirFunc[*models.Participant, *store.ParticipantStore],
- CreateEntityFunc: func() *models.Participant {
- return &models.Participant{
- Attributes: make(map[string]string),
- }
- },
- },
- )
- }
|