Documentation ¶
Index ¶
- Variables
- type NotFound
- type PoolConfig
- type RdsCache
- func (c *RdsCache) Del(ctx context.Context, keys ...interface{}) error
- func (c *RdsCache) Get(ctx context.Context, key, value interface{}) error
- func (c *RdsCache) Set(ctx context.Context, key, value interface{}) error
- func (c *RdsCache) SetWithTTL(ctx context.Context, key, value interface{}, TTL time.Duration) error
- type RdsOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Marshal 数据序列化函数 Marshal = msgpack.Marshal // Unmarshal 数据反序列化函数 Unmarshal = msgpack.Unmarshal )
Functions ¶
This section is empty.
Types ¶
type PoolConfig ¶
type PoolConfig struct { Dial func(network, addr string) (net.Conn, error) DB int Password string MaxIdle int MaxActive int IdleTimeout time.Duration Wait bool MaxConnLifetime time.Duration }
PoolConfig redis池连接参数
type RdsCache ¶
type RdsCache struct {
// contains filtered or unexported fields
}
RdsCache redis存储实现
func NewRdsCache ¶
func NewRdsCache(ctx context.Context, network, address string, poolCfg PoolConfig, options ...RdsOption) *RdsCache
NewRdsCache 创建redis缓存对象 内部创建redis连接池
func NewRdsCacheWithPool ¶
NewRdsCacheWithPool 创建redis缓存对象 使用现有redis连接池
type RdsOption ¶
type RdsOption struct {
// contains filtered or unexported fields
}
RdsOption rdscache配置
func RdsDefaultTTLOption ¶
RdsDefaultTTLOption 配置key默认生存时间
func RdsKeyPrefixOption ¶
RdsKeyPrefixOption 配置key前缀
Click to show internal directories.
Click to hide internal directories.