Documentation ¶
Index ¶
- Variables
- type HybridCacher
- func (c *HybridCacher) Bytes(ctx context.Context, key string) (bytes []byte, err error)
- func (c *HybridCacher) BytesMany(ctx context.Context, keys ...string) (result map[string][]byte, err error)
- func (c *HybridCacher) Close() error
- func (c *HybridCacher) Delete(ctx context.Context, key string) error
- func (c *HybridCacher) DeleteMany(ctx context.Context, keys ...string) (err error)
- func (c *HybridCacher) Errors() <-chan error
- func (c *HybridCacher) Exists(ctx context.Context, key string) (bool, error)
- func (c *HybridCacher) Identity() uuid.UUID
- func (c *HybridCacher) Local() cache.Cacher
- func (c *HybridCacher) Redis() *redis.RedisCacher
- func (c *HybridCacher) Set(ctx context.Context, key string, bytes []byte, duration time.Duration) error
- func (c *HybridCacher) SetMany(ctx context.Context, items map[string][]byte) (err error)
- func (c *HybridCacher) SetManyExp(ctx context.Context, items map[string][]byte, duration time.Duration) (err error)
- type HybridEvictCallback
- type HybridOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrLocalCacheIsNotInitialised = errors.New("local cache is not initialised")
)
Functions ¶
This section is empty.
Types ¶
type HybridCacher ¶
type HybridCacher struct {
// contains filtered or unexported fields
}
func NewHybridCacher ¶
func NewHybridCacher(config HybridOptions) (*HybridCacher, error)
func (*HybridCacher) BytesMany ¶
func (c *HybridCacher) BytesMany(ctx context.Context, keys ...string) (result map[string][]byte, err error)
BytesMany implements cache.Cacher
func (*HybridCacher) Delete ¶
func (c *HybridCacher) Delete( ctx context.Context, key string, ) error
Delete implements cache.Cacher
func (*HybridCacher) DeleteMany ¶
func (c *HybridCacher) DeleteMany(ctx context.Context, keys ...string) (err error)
DeleteMany implements cache.Cacher
func (*HybridCacher) Errors ¶
func (c *HybridCacher) Errors() <-chan error
func (*HybridCacher) Identity ¶
func (c *HybridCacher) Identity() uuid.UUID
func (*HybridCacher) Local ¶
func (c *HybridCacher) Local() cache.Cacher
func (*HybridCacher) Redis ¶
func (c *HybridCacher) Redis() *redis.RedisCacher
func (*HybridCacher) Set ¶
func (c *HybridCacher) Set( ctx context.Context, key string, bytes []byte, duration time.Duration, ) error
Set implements cache.Cacher
func (*HybridCacher) SetManyExp ¶
func (c *HybridCacher) SetManyExp(ctx context.Context, items map[string][]byte, duration time.Duration) (err error)
SetManyExp implements cache.Cacher
type HybridEvictCallback ¶
type HybridEvictCallback func(keys ...string)
type HybridOptions ¶
type HybridOptions struct { Topic string RedisCacher *redis.RedisCacher LocalCache cache.Cacher EvictCallback HybridEvictCallback }
Click to show internal directories.
Click to hide internal directories.