Files
crowsnest/internal/data/IRepository.go

14 lines
540 B
Go
Raw Normal View History

2024-12-27 22:34:43 +01:00
package data
2024-12-28 01:28:36 +01:00
// An interface to manage generic structure objects persistently. Should use an
// IDatastore as the interface that actually stores and retrieves the data from
// an external source.
2024-12-27 22:34:43 +01:00
type IRepository[T IIdentifiable] interface {
Create(t T) error
Update(t T) error
Delete(t T) error
GetAll() ([]T, error)
GetById(id uint) (T, error)
GetByCriteria(c ISearchCriteria[T]) ([]T, error)
}