crudmocks

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUD

type CRUD[T dbsql.Resource] struct {
	mock.Mock
}

CRUD is an autogenerated mock type for the CRUD type

func NewCRUD

func NewCRUD[T dbsql.Resource](t interface {
	mock.TestingT
	Cleanup(func())
}) *CRUD[T]

NewCRUD creates a new instance of CRUD. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*CRUD[T]) Count

func (_m *CRUD[T]) Count(ctx context.Context, filter ffapi.Filter) (int64, error)

Count provides a mock function with given fields: ctx, filter

func (*CRUD[T]) Delete

func (_m *CRUD[T]) Delete(ctx context.Context, id string, hooks ...dbsql.PostCompletionHook) error

Delete provides a mock function with given fields: ctx, id, hooks

func (*CRUD[T]) DeleteMany

func (_m *CRUD[T]) DeleteMany(ctx context.Context, filter ffapi.Filter, hooks ...dbsql.PostCompletionHook) error

DeleteMany provides a mock function with given fields: ctx, filter, hooks

func (*CRUD[T]) GetByID

func (_m *CRUD[T]) GetByID(ctx context.Context, id string, getOpts ...dbsql.GetOption) (T, error)

GetByID provides a mock function with given fields: ctx, id, getOpts

func (*CRUD[T]) GetByName

func (_m *CRUD[T]) GetByName(ctx context.Context, name string, getOpts ...dbsql.GetOption) (T, error)

GetByName provides a mock function with given fields: ctx, name, getOpts

func (*CRUD[T]) GetByUUIDOrName

func (_m *CRUD[T]) GetByUUIDOrName(ctx context.Context, uuidOrName string, getOpts ...dbsql.GetOption) (T, error)

GetByUUIDOrName provides a mock function with given fields: ctx, uuidOrName, getOpts

func (*CRUD[T]) GetFirst

func (_m *CRUD[T]) GetFirst(ctx context.Context, filter ffapi.Filter, getOpts ...dbsql.GetOption) (T, error)

GetFirst provides a mock function with given fields: ctx, filter, getOpts

func (*CRUD[T]) GetMany

func (_m *CRUD[T]) GetMany(ctx context.Context, filter ffapi.Filter) ([]T, *ffapi.FilterResult, error)

GetMany provides a mock function with given fields: ctx, filter

func (*CRUD[T]) GetQueryFactory added in v1.4.1

func (_m *CRUD[T]) GetQueryFactory() ffapi.QueryFactory

GetQueryFactory provides a mock function with given fields:

func (*CRUD[T]) GetSequenceForID

func (_m *CRUD[T]) GetSequenceForID(ctx context.Context, id string) (int64, error)

GetSequenceForID provides a mock function with given fields: ctx, id

func (*CRUD[T]) Insert

func (_m *CRUD[T]) Insert(ctx context.Context, inst T, hooks ...dbsql.PostCompletionHook) error

Insert provides a mock function with given fields: ctx, inst, hooks

func (*CRUD[T]) InsertMany

func (_m *CRUD[T]) InsertMany(ctx context.Context, instances []T, allowPartialSuccess bool, hooks ...dbsql.PostCompletionHook) error

InsertMany provides a mock function with given fields: ctx, instances, allowPartialSuccess, hooks

func (*CRUD[T]) ModifyQuery

func (_m *CRUD[T]) ModifyQuery(modifier func(squirrel.SelectBuilder) (squirrel.SelectBuilder, error)) dbsql.CRUDQuery[T]

ModifyQuery provides a mock function with given fields: modifier

func (*CRUD[T]) NewFilterBuilder

func (_m *CRUD[T]) NewFilterBuilder(ctx context.Context) ffapi.FilterBuilder

NewFilterBuilder provides a mock function with given fields: ctx

func (*CRUD[T]) NewUpdateBuilder

func (_m *CRUD[T]) NewUpdateBuilder(ctx context.Context) ffapi.UpdateBuilder

NewUpdateBuilder provides a mock function with given fields: ctx

func (*CRUD[T]) Replace

func (_m *CRUD[T]) Replace(ctx context.Context, inst T, hooks ...dbsql.PostCompletionHook) error

Replace provides a mock function with given fields: ctx, inst, hooks

func (*CRUD[T]) Scoped

func (_m *CRUD[T]) Scoped(scope squirrel.Eq) dbsql.CRUD[T]

Scoped provides a mock function with given fields: scope

func (*CRUD[T]) TableAlias added in v1.4.6

func (_m *CRUD[T]) TableAlias() string

TableAlias provides a mock function with given fields:

func (*CRUD[T]) Update

func (_m *CRUD[T]) Update(ctx context.Context, id string, update ffapi.Update, hooks ...dbsql.PostCompletionHook) error

Update provides a mock function with given fields: ctx, id, update, hooks

func (*CRUD[T]) UpdateMany

func (_m *CRUD[T]) UpdateMany(ctx context.Context, filter ffapi.Filter, update ffapi.Update, hooks ...dbsql.PostCompletionHook) error

UpdateMany provides a mock function with given fields: ctx, filter, update, hooks

func (*CRUD[T]) UpdateSparse

func (_m *CRUD[T]) UpdateSparse(ctx context.Context, sparseUpdate T, hooks ...dbsql.PostCompletionHook) error

UpdateSparse provides a mock function with given fields: ctx, sparseUpdate, hooks

func (*CRUD[T]) Upsert

func (_m *CRUD[T]) Upsert(ctx context.Context, inst T, optimization dbsql.UpsertOptimization, hooks ...dbsql.PostCompletionHook) (bool, error)

Upsert provides a mock function with given fields: ctx, inst, optimization, hooks

func (*CRUD[T]) Validate

func (_m *CRUD[T]) Validate()

Validate provides a mock function with given fields:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL