Documentation ¶
Overview ¶
Package mem contains in-memory implementations of hohin interfaces.
Index ¶
- type DB
- type Repo
- func (r *Repo[T]) Add(ctx context.Context, d hohin.DB, entity T) error
- func (r *Repo[T]) AddMany(ctx context.Context, d hohin.DB, entities []T) error
- func (r *Repo[T]) Clear(ctx context.Context, d hohin.DB) error
- func (r Repo[T]) Count(ctx context.Context, d hohin.DB, f hohin.Filter) (uint64, error)
- func (r *Repo[T]) CountAll(ctx context.Context, d hohin.DB) (uint64, error)
- func (r *Repo[T]) Delete(ctx context.Context, d hohin.DB, f hohin.Filter) error
- func (r *Repo[T]) Exists(ctx context.Context, d hohin.DB, f hohin.Filter) (bool, error)
- func (r *Repo[T]) Get(ctx context.Context, d hohin.DB, f hohin.Filter) (T, error)
- func (r *Repo[T]) GetFirst(ctx context.Context, d hohin.DB, q hohin.Query) (T, error)
- func (r *Repo[T]) GetForUpdate(ctx context.Context, d hohin.DB, f hohin.Filter) (T, error)
- func (r *Repo[T]) GetMany(ctx context.Context, d hohin.DB, q hohin.Query) ([]T, error)
- func (r *Repo[T]) Simple() hohin.SimpleRepo[T]
- func (r *Repo[T]) Update(ctx context.Context, d hohin.DB, f hohin.Filter, entity T) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements hohin.DB for an in-memory data structure.
func (*DB) Transaction ¶
type Repo ¶
type Repo[T any] struct { // contains filtered or unexported fields }
Repo implements hohin.Repo for an in-memory data structure.
func (*Repo[T]) GetForUpdate ¶
func (*Repo[T]) Simple ¶
func (r *Repo[T]) Simple() hohin.SimpleRepo[T]
Click to show internal directories.
Click to hide internal directories.