Documentation ¶
Index ¶
- func AsyncSave() func(opt *Option)
- func SaveEmpty() func(opt *Option)
- func WithoutReplicate() func(opt *Option)
- type Cacheable
- type Codec
- type Context
- func (c *Context[R]) Del(key string) error
- func (c *Context[R]) Get(key string) ([]byte, error)
- func (c *Context[R]) GetContext() context.Context
- func (c *Context[R]) GetDriver() Driver
- func (c *Context[R]) GetName() string
- func (c *Context[R]) Set(key string, data []byte) error
- func (c *Context[R]) SetContext(ctx context.Context)
- type Driver
- type Manager
- func (m *Manager[T]) Del(ctx context.Context, key string) error
- func (m *Manager[T]) Get(ctx context.Context, key string) (ok bool, data T, err error)
- func (m *Manager[T]) GetOrSet(ctx context.Context, key string, cacheable Cacheable[T], opts ...OptionSet) (data T, err error)
- func (m *Manager[T]) Set(ctx context.Context, key string, data T, opts ...OptionSet) (err error)
- func (m *Manager[T]) Use(mid Middleware[T]) *Manager[T]
- type Metric
- type Middleware
- type Option
- type OptionSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithoutReplicate ¶
func WithoutReplicate() func(opt *Option)
Types ¶
type Context ¶
type Context[R any] struct { // contains filtered or unexported fields }
func NewContext ¶
func NewContext[R any](name string, d Driver, m ...Middleware[R]) *Context[R]
func (*Context[R]) GetContext ¶
func (*Context[R]) SetContext ¶
type Manager ¶
type Manager[T any] struct { // contains filtered or unexported fields }
func (*Manager[T]) Use ¶
func (m *Manager[T]) Use(mid Middleware[T]) *Manager[T]
type Middleware ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.