Documentation
¶
Overview ¶
Cache package to provide an interface to interact with cache stores.
Index ¶
- Variables
- type BigCacheClient
- type BigCacheStore
- type Cache
- func (c *Cache) Clear(ctx context.Context) error
- func (c *Cache) Delete(ctx context.Context, key string) error
- func (c *Cache) Get(ctx context.Context, key string) ([]byte, error)
- func (c Cache) MarshalZerologObject(encoder *zerolog.Event)
- func (c *Cache) Set(ctx context.Context, key string, item []byte) error
- type RedisClient
- type RedisStore
- type Store
- type StoreType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCacheIsDisabled = errors.New("cache is disabled") ErrRedisOptionsNil = errors.New("redis options is nil") )
Functions ¶
This section is empty.
Types ¶
type BigCacheClient ¶
type BigCacheStore ¶
type BigCacheStore struct {
// contains filtered or unexported fields
}
func (*BigCacheStore) Delete ¶
func (s *BigCacheStore) Delete(_ctx context.Context, key string) error
type Cache ¶
type Cache struct {
StoreType StoreType
TTL time.Duration
Enabled bool
// contains filtered or unexported fields
}
func NewBigCache ¶
Creates a new Cache using BigCache.
Requires a BigCache config that can be created with bigcache.DefaultConfig(n*time.Minute).
func (*Cache) Get ¶
Returns an item from the cache. If no item is found, returns nil for the item and error.
func (Cache) MarshalZerologObject ¶ added in v1.0.0
type RedisClient ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.