Files
crowsnest/internal/data/IRepository.go

14 lines
540 B
Go

package data
// 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.
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)
}