Documentation
¶
Index ¶
- Variables
- type OnDeleteFn
- type OnNotFoundFn
- type OnUpdateFn
- type Option
- type Store
- func (s *Store[T, U]) ComputeUpdate(ctx context.Context, key string, load bool, ...) error
- func (s *Store[T, U]) Delete(ctx context.Context, key string) error
- func (s *Store[T, U]) Get(key string) (U, bool)
- func (s *Store[T, U]) GetOrLoad(ctx context.Context, key string) (U, error)
- func (s *Store[T, U]) Keys(ctx context.Context, prefix string) ([]string, error)
- func (s *Store[T, U]) List() ([]U, error)
- func (s *Store[T, U]) Load(ctx context.Context, key string) (U, error)
- func (s *Store[T, U]) Put(ctx context.Context, key string, msg U) error
- func (s *Store[T, U]) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("store: not found")
Functions ¶
This section is empty.
Types ¶
type OnDeleteFn ¶ added in v0.8.20
type OnDeleteFn[T any, U protoMessage[T]] func(jetstream.KeyValueEntry, U) error
type OnNotFoundFn ¶ added in v0.8.21
type OnUpdateFn ¶ added in v0.8.20
type Store ¶
type Store[T any, U protoMessage[T]] struct { OnUpdate OnUpdateFn[T, U] OnDelete OnDeleteFn[T, U] OnNotFound OnNotFoundFn[T, U] // contains filtered or unexported fields }
func NewWithLocks ¶ added in v0.8.20
func (*Store[T, U]) ComputeUpdate ¶
func (*Store[T, U]) Load ¶
Load data from kv store (this will add/update any existing local data entry) If no key is found, the original nats error is returned.
Click to show internal directories.
Click to hide internal directories.