Documentation ¶
Overview ¶
Package crud provides a set of tests for CRUD operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EntityOps ¶
type EntityOps[T, K any] struct { NewEntity func(key int) T // create a new entity with the given key ModifyEntity func(model T) T // modify the given entity UnboundEntity func() T // entity with no key ExtractKey func(T) K // key extractor MissingKey func() K // key that does not exist }
EntityOps contains the operations that do not operate on the repository, but on the entity itself.
type RepoOps ¶
type RepoOps[T, K any] struct { GetAll func(ctx context.Context) ([]T, error) GetByID func(ctx context.Context, id K) (T, error) Create func(ctx context.Context, model T) error Update func(ctx context.Context, model T) error Delete func(ctx context.Context, id K) error }
RepoOps contains the operations that operate on the repository.
Click to show internal directories.
Click to hide internal directories.