Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Clear() error
- func (c *Cache) Close() error
- func (c *Cache) Decr(key string) error
- func (c *Cache) Delete(key string) error
- func (c *Cache) Get(key string, val interface{}) error
- func (c *Cache) Incr(key string) error
- func (c *Cache) IsExist(key string) bool
- func (c *Cache) ListKey(req *cache.ListKeyRequest) (*cache.ListKeyResponse, error)
- func (c *Cache) Put(key string, val interface{}) error
- func (c *Cache) PutWithTTL(key string, val interface{}, ttl time.Duration) error
- func (c *Cache) SetDefaultTTL(ttl time.Duration)
- func (c *Cache) WithContext(ctx context.Context) cache.ICache
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache 缓存
func (*Cache) ListKey ¶
func (c *Cache) ListKey(req *cache.ListKeyRequest) (*cache.ListKeyResponse, error)
ListKey 根据缓存Request返回缓存中的Response(redis).
func (*Cache) PutWithTTL ¶
PutWithTTL 推送Kev => Value 并设置TTL时间戳(redis).
func (*Cache) SetDefaultTTL ¶
SetDefaultTTL 设置默认TTL时间戳(redis).
type Config ¶
type Config struct { Prefix string `json:"prefix,omitempty" yaml:"prefix" toml:"prefix" env:"GLACIER_DEVOPS_CACHE_PREFIX"` Address string `json:"address,omitempty" yaml:"address" toml:"address" env:"GLACIER_DEVOPS_CACHE_ADDRESS"` DB int `json:"db,omitempty" yaml:"db" toml:"db" env:"GLACIER_DEVOPS_CACHE_DB"` Password string `json:"password,omitempty" yaml:"password" toml:"password" env:"GLACIER_DEVOPS_CACHE_PASSWORD"` DefaultTTL int `json:"default_ttl,omitempty" yaml:"default_ttl" toml:"default_ttl" env:"GLACIER_DEVOPS_CACHE_TTL"` }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
Click to show internal directories.
Click to hide internal directories.