Documentation ¶
Index ¶
- Variables
- type Backend
- type Cache
- type ChainBackend
- func (b *ChainBackend) Del(ctx context.Context, key string) (err error)
- func (b *ChainBackend) DelAll(ctx context.Context) (err error)
- func (b *ChainBackend) Get(ctx context.Context, key string) ([]byte, error)
- func (b *ChainBackend) Set(ctx context.Context, key string, value []byte, ttl time.Duration) (err error)
- type FreeBackend
- type Item
- type MapBackend
- func (b *MapBackend) Del(_ context.Context, key string) error
- func (b *MapBackend) DelAll(context.Context) error
- func (b *MapBackend) DelExpired()
- func (b *MapBackend) Get(_ context.Context, key string) ([]byte, error)
- func (b *MapBackend) Items() map[string]Item
- func (b *MapBackend) Set(_ context.Context, key string, value []byte, ttl time.Duration) error
- type NopCache
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = freecache.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type ChainBackend ¶
type ChainBackend struct {
// contains filtered or unexported fields
}
func NewChainBackend ¶
func NewChainBackend(backends ...Backend) *ChainBackend
type FreeBackend ¶
type FreeBackend struct {
// contains filtered or unexported fields
}
func NewFreeBackend ¶
func NewFreeBackend(size int) *FreeBackend
type MapBackend ¶
type MapBackend struct {
// contains filtered or unexported fields
}
func NewMapBackend ¶
func NewMapBackend(cleanupInterval time.Duration) *MapBackend
func NewMapBackendFrom ¶
func NewMapBackendFrom(cleanupInterval time.Duration, items map[string]Item) *MapBackend
func (*MapBackend) DelExpired ¶
func (b *MapBackend) DelExpired()
func (*MapBackend) Items ¶
func (b *MapBackend) Items() map[string]Item
Source Files ¶
Click to show internal directories.
Click to hide internal directories.