Documentation
¶
Index ¶
- func GetCacheCli(config *CacheCfg) (*redis.Client, error)
- type CacheCfg
- type HashCache
- type ICache
- type SetCache
- type StrCache
- func (c *StrCache) Del(ctx context.Context, keys ...string) error
- func (c *StrCache) Exist(ctx context.Context, key string) (bool, error)
- func (c *StrCache) Get(ctx context.Context, key string) (string, error)
- func (c *StrCache) Set(ctx context.Context, key string, value interface{}) error
- func (c *StrCache) SetEx(ctx context.Context, key string, value interface{}, expire time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCacheCli ¶
Types ¶
type CacheCfg ¶
type CacheCfg struct { ClientName string `json:"client_name" yaml:"client_name" env:"name=CACHE_CLIENT_NAME"` Address string `json:"address" yaml:"address" env:"name=CACHE_ADDRESS"` Username string `json:"username" yaml:"username" env:"name=CACHE_USERNAME"` Password string `json:"password" yaml:"password" env:"name=CACHE_PASSWORD"` DB int `json:"db" yaml:"db" env:"name=CACHE_DB"` }
type HashCache ¶
type HashCache struct {
// contains filtered or unexported fields
}
func NewHashCache ¶
type SetCache ¶
type SetCache struct {
// contains filtered or unexported fields
}
func NewSetCache ¶
Click to show internal directories.
Click to hide internal directories.