Documentation ¶
Index ¶
- type EntityModelInterface
- type ID
- type Limit
- type Order
- type Paginate
- type PaginateID
- type RepoCache
- func (it *RepoCache[T]) Create(ctx context.Context, m T) (T, error)
- func (it *RepoCache[T]) Delete(ctx context.Context, id ID) error
- func (it *RepoCache[T]) Find(ctx context.Context, where Where) (Paginate[T], error)
- func (it *RepoCache[T]) FindByID(ctx context.Context, id ID) (T, error)
- func (it *RepoCache[T]) FindOne(ctx context.Context, where Where) (T, error)
- func (it *RepoCache[T]) Update(ctx context.Context, m T) (T, error)
- type RepoCacheInterface
- type RepoInterface
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityModelInterface ¶
type Paginate ¶
type Paginate[T EntityModelInterface] struct { Items []T `json:"items"` Total int64 `json:"total"` Limit Limit `json:"limit"` }
type PaginateID ¶
type RepoCache ¶
type RepoCache[T EntityModelInterface] struct { // contains filtered or unexported fields }
type RepoCacheInterface ¶
type RepoCacheInterface[T EntityModelInterface] interface { FindByID(context.Context, ID) (T, error) Update(context.Context, T) (T, error) Delete(context.Context, ID) error Create(context.Context, T) (T, error) Find(context.Context, Where) (Paginate[T], error) FindOne(context.Context, Where) (T, error) }
func NewRepoCache ¶
func NewRepoCache[T EntityModelInterface](repo RepoInterface[T], storage storage.StorageInterface) RepoCacheInterface[T]
type RepoInterface ¶
type RepoInterface[T EntityModelInterface] interface { FindByID(context.Context, ID) (T, error) Update(context.Context, T) (T, error) Delete(context.Context, ID) error Create(context.Context, T) (T, error) Find(context.Context, Where) (PaginateID, error) FindOne(context.Context, Where) (ID, error) }
Click to show internal directories.
Click to hide internal directories.