Documentation ¶
Index ¶
- Variables
- type Option
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(namespace string, key []byte) error
- func (s *Store) DeleteNamespace(namespace string) error
- func (s *Store) Get(namespace, key []byte) ([]byte, error)
- func (s *Store) Load(key string, obj any) error
- func (s *Store) Memoize(key string, obj any, f func() (any, error)) error
- func (s *Store) MemoizeWithTTL(key string, obj any, f func() (any, error), ttl int64) error
- func (s *Store) Put(namespace string, key, value []byte) (err error)
- func (s *Store) PutWithTTL(namespace, key, value []byte, ttl int64) (err error)
- func (s *Store) Remove(key string) error
- func (s *Store) Update(key string, value any) error
- func (s *Store) UpdateWithTTL(key string, value any, ttl int64) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyNotFound is returned when the key supplied to a Get or Delete // method does not exist in the database. ErrKeyNotFound = errors.New("key not found") // ErrKeyExpired is returned when the key supplied to a Get or Delete ErrKeyExpired = errors.New("key expired") // ErrBadValue is returned when the value supplied to the Put method // is nil. ErrBadValue = errors.New("bad value") )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*option) error
Option the tracer provider option
func WithMaxCacheSize ¶
WithMaxCacheSize sets the maximum number of items in the LRU cache.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is KVStore implementation based bolt DB
func (*Store) DeleteNamespace ¶ added in v1.1.0
DeleteNamespace deletes a namespace
func (*Store) MemoizeWithTTL ¶ added in v1.1.0
func (*Store) PutWithTTL ¶ added in v1.1.0
PutWithTTL inserts a <key, value> record with TTL
Click to show internal directories.
Click to hide internal directories.