Documentation
¶
Index ¶
- Variables
- type Collection
- type ErrConflictGeneration
- type GenericStore
- func (s *GenericStore[T, H]) Delete(ctx context.Context, id string) error
- func (s *GenericStore[T, H]) Get(ctx context.Context) (*Collection[T], error)
- func (s *GenericStore[T, H]) Read(ctx context.Context, txn ReadTxn[T]) error
- func (s *GenericStore[T, H]) Update(ctx context.Context, txn UpdateTxn[T]) error
- func (s *GenericStore[T, H]) Upsert(ctx context.Context, elem T, observedGeneration *int64) error
- type Key
- type ReadTxn
- type StoreHelper
- type UpdateTxn
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrElementNotFound = errors.New("element not found")
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type ErrConflictGeneration ¶
func (ErrConflictGeneration) Error ¶
func (e ErrConflictGeneration) Error() string
type GenericStore ¶
type GenericStore[T any, H StoreHelper[T]] struct { // contains filtered or unexported fields }
func New ¶
func New[T any, H StoreHelper[T]]( logger log.Logger, bucket objstore.Bucket, key Key, helper H, ) *GenericStore[T, H]
func (*GenericStore[T, H]) Delete ¶
func (s *GenericStore[T, H]) Delete(ctx context.Context, id string) error
func (*GenericStore[T, H]) Get ¶
func (s *GenericStore[T, H]) Get(ctx context.Context) (*Collection[T], error)
func (*GenericStore[T, H]) Read ¶
func (s *GenericStore[T, H]) Read(ctx context.Context, txn ReadTxn[T]) error
type ReadTxn ¶
type ReadTxn[T any] func(context.Context, *Collection[T]) error
ReadTxn is a transaction that runs under the read lock of the cache. The Collection should not be mutated at all.
type StoreHelper ¶
Click to show internal directories.
Click to hide internal directories.