Documentation ¶
Index ¶
- type Addable
- type Locker
- type Manager
- type NullStore
- func (n *NullStore) Decrement(context.Context, string, int) (int, error)
- func (n *NullStore) Flush(context.Context) (bool, error)
- func (n *NullStore) Forever(context.Context, string, any) (bool, error)
- func (n *NullStore) Forget(context.Context, string) (bool, error)
- func (n *NullStore) Get(context.Context, string, any) error
- func (n *NullStore) GetPrefix() string
- func (n *NullStore) Has(context.Context, string) (bool, error)
- func (n *NullStore) Increment(context.Context, string, int) (int, error)
- func (n *NullStore) Lock(string, time.Duration) locker.Locker
- func (n *NullStore) Put(context.Context, string, any, time.Duration) (bool, error)
- type Repository
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶ added in v2.8.0
type Manager struct { Repository // contains filtered or unexported fields }
func NewManager ¶ added in v2.8.0
func NewManager(repository Repository) *Manager
func (*Manager) Driver ¶ added in v2.8.0
func (m *Manager) Driver(names ...string) Repository
func (*Manager) Register ¶ added in v2.8.0
func (m *Manager) Register(name string, repository Repository)
type NullStore ¶ added in v2.16.0
type NullStore struct{}
type Repository ¶
type Repository interface { Store Addable Missing(ctx context.Context, key string) (bool, error) Delete(ctx context.Context, key string) (bool, error) Set(ctx context.Context, key string, value any, ttl time.Duration) (bool, error) Remember(ctx context.Context, key string, dest any, value func() any, ttl time.Duration) error }
func NewRepository ¶
func NewRepository(store Store) Repository
type Store ¶
type Store interface { Locker Has(ctx context.Context, key string) (bool, error) Get(ctx context.Context, key string, dest any) error Put(ctx context.Context, key string, value any, ttl time.Duration) (bool, error) Increment(ctx context.Context, key string, value int) (int, error) Decrement(ctx context.Context, key string, value int) (int, error) Forever(ctx context.Context, key string, value any) (bool, error) Forget(ctx context.Context, key string) (bool, error) Flush(ctx context.Context) (bool, error) GetPrefix() string }
Click to show internal directories.
Click to hide internal directories.