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, interface{}) (bool, error)
- func (n *NullStore) Forget(context.Context, string) (bool, error)
- func (n *NullStore) Get(context.Context, string, interface{}) 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, interface{}, 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 interface{}, ttl time.Duration) (bool, error) Remember(ctx context.Context, key string, dest interface{}, value func() interface{}, 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 interface{}) error Put(ctx context.Context, key string, value interface{}, 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 interface{}) (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.