Documentation ¶
Index ¶
Constants ¶
View Source
const ( OpNew = "repository: new ->" OpIter = "repository: iter ->" OpFind = "repository: find ->" OpFindIter = "repository: find iter ->" OpFindByID = "repository: find by ID ->" OpCount = "repository: count ->" OpSave = "repository: save ->" OpRemove = "repository: remove ->" OpIndexes = "repository: indexes ->" ErrMsgDecode = "failed to decode entity due to error: %w" ErrMsgAfterFind = "failed after find callback due to error: %w" )
Variables ¶
View Source
var ( ErrEntityNotFound = errors.New("could not find entity") ErrDuplicateKey = errors.New("entity duplicate key") ErrMissingEntityID = errors.New("missing entity ID") ErrMissingCursor = errors.New("missing iterator cursor") ErrMissingEntityFactory = errors.New("missing entity factory") )
Functions ¶
This section is empty.
Types ¶
type EntityFactory ¶
type EntityFactory[T Entity] interface { NewEntity() T }
func Factory ¶
func Factory[T Entity]() EntityFactory[T]
type EntityFactoryFunc ¶
type EntityFactoryFunc[T Entity] func() T
func (EntityFactoryFunc[T]) NewEntity ¶
func (f EntityFactoryFunc[T]) NewEntity() T
type Iterator ¶
type Iterator[T Entity] struct { Cursor Cursor Factory EntityFactory[T] AfterFind func(entity T) error // contains filtered or unexported fields }
type ReadRepository ¶
type ReadWriteRepository ¶
type ReadWriteRepository[T Entity] interface { ReadRepository[T] WriteRepository[T] }
Click to show internal directories.
Click to hide internal directories.