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)
|
2024-12-29 01:05:04 +01:00
|
|
|
GetById(id string) (T, error)
|
2024-12-27 22:34:43 +01:00
|
|
|
GetByCriteria(c ISearchCriteria[T]) ([]T, error)
|
|
|
|
|
}
|