Documentation
¶
Index ¶
- type CCache
- func (c *CCache) Delete(key string) bool
- func (c *CCache) Get(key string) interface{}
- func (c *CCache) GetInt(key string) int
- func (c *CCache) GetInt64(key string) int64
- func (c *CCache) GetString(key string) string
- func (c *CCache) IsEnabled() bool
- func (c *CCache) Set(key string, val interface{})
- func (c *CCache) SetInt(key string, val int)
- func (c *CCache) SetInt64(key string, val int64)
- func (c *CCache) SetString(key string, val string)
- type CInterface
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CInterface ¶
type CInterface interface { IsEnabled() bool Delete(key string) bool Get(key string) interface{} Set(key string, val interface{}) GetString(key string) string SetString(key string, val string) GetInt(key string) int SetInt(key string, val int) GetInt64(key string) int64 SetInt64(key string, val int64) }
CInterface contains functions a cache instance need to provide
func NewUmanagedCache ¶
should only be used for testing purpose
type Manager ¶
type Manager interface { // Get a cache by name, if a cache already exists with the same name, it will be returned as is without checking maxSize, ttl and enabled matches GetCache(ctx context.Context, namespace, name string, maxSize int64, ttl time.Duration, enabled bool) (CInterface, error) ListCacheNames(namespace string) []string ResetCaches(namespace string) IsEnabled() bool }
Manager contains functions to manage cache instances. It provides functions for creating new cache instances and list all of the names of existing cache instances Each cache instance has unique name and its own cache size and TTL configuration.
Click to show internal directories.
Click to hide internal directories.