Documentation ¶
Index ¶
- type DbRepo
- func (dMock *DbRepo[T]) Count(ctx context.Context, filter repos.Filter) (int64, error)
- func (dMock *DbRepo[T]) Create(ctx context.Context, data T) (T, error)
- func (dMock *DbRepo[T]) CreateMany(ctx context.Context, data []T) error
- func (dMock *DbRepo[T]) DeleteById(ctx context.Context, id repos.ID) error
- func (dMock *DbRepo[T]) DeleteMany(ctx context.Context, filter repos.Filter) error
- func (dMock *DbRepo[T]) DeleteOne(ctx context.Context, filter repos.Filter) error
- func (dMock *DbRepo[T]) ErrAlreadyExists(err error) bool
- func (dMock *DbRepo[T]) Exists(ctx context.Context, filter repos.Filter) (bool, error)
- func (dMock *DbRepo[T]) Find(ctx context.Context, query repos.Query) ([]T, error)
- func (dMock *DbRepo[T]) FindById(ctx context.Context, id repos.ID) (T, error)
- func (dMock *DbRepo[T]) FindOne(ctx context.Context, filter repos.Filter) (T, error)
- func (dMock *DbRepo[T]) FindPaginated(ctx context.Context, filter repos.Filter, pagination repos.CursorPagination) (*repos.PaginatedRecord[T], error)
- func (dMock *DbRepo[T]) GroupByAndCount(ctx context.Context, filter repos.Filter, groupBy string, ...) (map[string]int64, error)
- func (dMock *DbRepo[T]) IndexFields(ctx context.Context, indices []repos.IndexField) error
- func (dMock *DbRepo[T]) MergeMatchFilters(filter repos.Filter, matchFilters ...map[string]repos.MatchFilter) repos.Filter
- func (dMock *DbRepo[T]) NewId() repos.ID
- func (dMock *DbRepo[T]) Patch(ctx context.Context, filter repos.Filter, patch repos.Document, ...) (T, error)
- func (dMock *DbRepo[T]) PatchById(ctx context.Context, id repos.ID, patch repos.Document, ...) (T, error)
- func (dMock *DbRepo[T]) PatchOne(ctx context.Context, filter repos.Filter, patch repos.Document, ...) (T, error)
- func (dMock *DbRepo[T]) UpdateById(ctx context.Context, id repos.ID, updatedData T, opts ...repos.UpdateOpts) (T, error)
- func (dMock *DbRepo[T]) UpdateMany(ctx context.Context, filter repos.Filter, updatedData map[string]any) error
- func (dMock *DbRepo[T]) UpdateOne(ctx context.Context, filter repos.Filter, updatedData T, ...) (T, error)
- func (dMock *DbRepo[T]) UpdateWithVersionCheck(ctx context.Context, id repos.ID, updatedData T) (T, error)
- func (dMock *DbRepo[T]) Upsert(ctx context.Context, filter repos.Filter, data T) (T, error)
- type DbRepoCallerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbRepo ¶
type DbRepo[T repos.Entity] struct { Calls map[string][]DbRepoCallerInfo MockCount func(ctx context.Context, filter repos.Filter) (int64, error) MockCreate func(ctx context.Context, data T) (T, error) MockCreateMany func(ctx context.Context, data []T) error MockDeleteById func(ctx context.Context, id repos.ID) error MockDeleteMany func(ctx context.Context, filter repos.Filter) error MockDeleteOne func(ctx context.Context, filter repos.Filter) error MockErrAlreadyExists func(err error) bool MockExists func(ctx context.Context, filter repos.Filter) (bool, error) MockFind func(ctx context.Context, query repos.Query) ([]T, error) MockFindById func(ctx context.Context, id repos.ID) (T, error) MockFindOne func(ctx context.Context, filter repos.Filter) (T, error) MockFindPaginated func(ctx context.Context, filter repos.Filter, pagination repos.CursorPagination) (*repos.PaginatedRecord[T], error) MockGroupByAndCount func(ctx context.Context, filter repos.Filter, groupBy string, opts repos.GroupByAndCountOptions) (map[string]int64, error) MockIndexFields func(ctx context.Context, indices []repos.IndexField) error MockMergeMatchFilters func(filter repos.Filter, matchFilters ...map[string]repos.MatchFilter) repos.Filter MockNewId func() repos.ID MockPatch func(ctx context.Context, filter repos.Filter, patch repos.Document, opts ...repos.UpdateOpts) (T, error) MockPatchById func(ctx context.Context, id repos.ID, patch repos.Document, opts ...repos.UpdateOpts) (T, error) MockPatchOne func(ctx context.Context, filter repos.Filter, patch repos.Document, opts ...repos.UpdateOpts) (T, error) MockUpdateById func(ctx context.Context, id repos.ID, updatedData T, opts ...repos.UpdateOpts) (T, error) MockUpdateMany func(ctx context.Context, filter repos.Filter, updatedData map[string]any) error MockUpdateOne func(ctx context.Context, filter repos.Filter, updatedData T, opts ...repos.UpdateOpts) (T, error) MockUpdateWithVersionCheck func(ctx context.Context, id repos.ID, updatedData T) (T, error) MockUpsert func(ctx context.Context, filter repos.Filter, data T) (T, error) }
func (*DbRepo[T]) CreateMany ¶
func (*DbRepo[T]) DeleteById ¶
func (*DbRepo[T]) DeleteMany ¶
func (*DbRepo[T]) ErrAlreadyExists ¶
func (*DbRepo[T]) FindPaginated ¶
func (dMock *DbRepo[T]) FindPaginated(ctx context.Context, filter repos.Filter, pagination repos.CursorPagination) (*repos.PaginatedRecord[T], error)
func (*DbRepo[T]) GroupByAndCount ¶
func (*DbRepo[T]) IndexFields ¶
func (*DbRepo[T]) MergeMatchFilters ¶
func (*DbRepo[T]) UpdateById ¶
func (*DbRepo[T]) UpdateMany ¶
func (*DbRepo[T]) UpdateWithVersionCheck ¶
type DbRepoCallerInfo ¶
type DbRepoCallerInfo struct {
Args []any
}
Click to show internal directories.
Click to hide internal directories.