Documentation
¶
Index ¶
- Variables
- type Cacher
- type InMemoryCache
- func (c *InMemoryCache) Delete(_ context.Context, key string) error
- func (c *InMemoryCache) Get(_ context.Context, key string) (interface{}, error)
- func (c *InMemoryCache) Has(ctx context.Context, key string) (bool, error)
- func (c *InMemoryCache) Set(_ context.Context, key string, value interface{}, ttl time.Duration) error
- type RedisCache
- func (c *RedisCache) Delete(ctx context.Context, key string) error
- func (c *RedisCache) Get(ctx context.Context, key string) (interface{}, error)
- func (c *RedisCache) Has(ctx context.Context, key string) (bool, error)
- func (c *RedisCache) Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("key not found") ErrExpired = errors.New("key expired") )
Functions ¶
This section is empty.
Types ¶
type InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
func NewInMemoryCache ¶
func NewInMemoryCache() *InMemoryCache
func (*InMemoryCache) Get ¶
func (c *InMemoryCache) Get(_ context.Context, key string) (interface{}, error)
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(addr, username, password string) (*RedisCache, error)
Click to show internal directories.
Click to hide internal directories.