Documentation ¶
Index ¶
Constants ¶
View Source
const ( OpNew errs.Op = "repository: new" OpIter errs.Op = "repository: iter" OpFind errs.Op = "repository: find" OpFindIter errs.Op = "repository: find iter" OpFindByID errs.Op = "repository: find by ID" OpCount errs.Op = "repository: count" OpSave errs.Op = "repository: save" OpRemove errs.Op = "repository: remove" OpIndexes errs.Op = "repository: indexes" ErrMsgDecode = "failed to decode entity due to error: %w" ErrMsgAfterFind = "failed after find callback due to error: %w" )
Variables ¶
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.