Documentation ¶
Index ¶
- Constants
- func SetConfiger(ctx context.Context, configerType constants.ConfigerType) error
- func WatchUpdate(ctx context.Context)
- type Cache
- type CacheData
- type CacheType
- type ConfigerType
- type RedisClient
- func NewCommonRedis(serverName string, poolSize int) (*RedisClient, error)
- func NewCoreRedis(serverName string, poolSize int) (*RedisClient, error)
- func NewRedisByAddr(addr, serverName string, poolSize int) (*RedisClient, error)
- func NewRedisByNamespace(ctx context.Context, namespace string) (*RedisClient, error)
- func (m *RedisClient) Del(keys ...string) *go_redis.IntCmd
- func (m *RedisClient) Expire(key string, expiration time.Duration) *go_redis.BoolCmd
- func (m *RedisClient) Get(key string) *go_redis.StringCmd
- func (m *RedisClient) Incr(key string) *go_redis.IntCmd
- func (m *RedisClient) Set(key string, value interface{}, expiration time.Duration) *go_redis.StatusCmd
- func (m *RedisClient) SetNX(key string, value interface{}, expiration time.Duration) *go_redis.BoolCmd
- func (m *RedisClient) TTL(key string) *go_redis.DurationCmd
Constants ¶
View Source
const ( SpanLogKeyKey = "key" SpanLogCacheType = "cache" SpanLogOp = "op" )
View Source
const ( WrapperTypeCache = "c" WrapperTypeRedisExt = "e" )
View Source
const DefaultRouteGroup = "default"
Variables ¶
This section is empty.
Functions ¶
func SetConfiger ¶
func SetConfiger(ctx context.Context, configerType constants.ConfigerType) error
func WatchUpdate ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
采用json进行序列化的的cache
func NewCacheByNamespace ¶
func NewCommonCache ¶
redis 地址列表,key前缀,过期时间
func NewCoreCache ¶
type ConfigerType ¶
type ConfigerType int
const ( ConfigerTypeSimple ConfigerType = iota ConfigerTypeEtcd ConfigerTypeApollo )
func (ConfigerType) String ¶
func (c ConfigerType) String() string
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func NewCommonRedis ¶
func NewCommonRedis(serverName string, poolSize int) (*RedisClient, error)
func NewCoreRedis ¶
func NewCoreRedis(serverName string, poolSize int) (*RedisClient, error)
func NewRedisByAddr ¶ added in v1.4.13
func NewRedisByAddr(addr, serverName string, poolSize int) (*RedisClient, error)
NewRedisByAddr ...
func NewRedisByNamespace ¶
func NewRedisByNamespace(ctx context.Context, namespace string) (*RedisClient, error)
func (*RedisClient) TTL ¶
func (m *RedisClient) TTL(key string) *go_redis.DurationCmd
Click to show internal directories.
Click to hide internal directories.