redis

package
v1.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInstanceManager = NewInstanceManager()
View Source
var RedisNil = fmt.Sprintf("redis: nil")

Functions

This section is empty.

Types

type ApolloConfig

type ApolloConfig struct {
	// contains filtered or unexported fields
}

func NewApolloConfiger

func NewApolloConfiger() *ApolloConfig

func (*ApolloConfig) GetConfig

func (m *ApolloConfig) GetConfig(ctx context.Context, namespace string) (*Config, error)

func (*ApolloConfig) Init

func (m *ApolloConfig) Init(ctx context.Context) error

func (*ApolloConfig) ParseKey

func (m *ApolloConfig) ParseKey(ctx context.Context, key string) (*KeyParts, error)

func (*ApolloConfig) Watch

func (m *ApolloConfig) Watch(ctx context.Context) <-chan *center.ChangeEvent

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, namespace string, wrapper string) (*Client, error)

func NewDefaultClient

func NewDefaultClient(ctx context.Context, namespace, addr, wrapper string, poolSize int, useWrapper bool, timeout time.Duration) (*Client, error)

func (*Client) Close

func (m *Client) Close(ctx context.Context) error

func (*Client) Decr

func (m *Client) Decr(ctx context.Context, key string) *redis.IntCmd

func (*Client) DecrBy

func (m *Client) DecrBy(ctx context.Context, key string, value int64) *redis.IntCmd

func (*Client) Del

func (m *Client) Del(ctx context.Context, keys ...string) *redis.IntCmd

func (*Client) Eval added in v1.3.35

func (m *Client) Eval(ctx context.Context, script string, keys []string, args ...interface{}) *redis.Cmd

func (*Client) EvalSha added in v1.3.35

func (m *Client) EvalSha(ctx context.Context, scriptHash string, keys []string, args ...interface{}) *redis.Cmd

func (*Client) Exists

func (m *Client) Exists(ctx context.Context, key string) *redis.IntCmd

func (*Client) Expire

func (m *Client) Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd

func (*Client) Get

func (m *Client) Get(ctx context.Context, key string) *redis.StringCmd

func (*Client) GetBit

func (m *Client) GetBit(ctx context.Context, key string, offset int64) *redis.IntCmd

func (*Client) HDel

func (m *Client) HDel(ctx context.Context, key string, fields ...string) *redis.IntCmd

func (*Client) HExists

func (m *Client) HExists(ctx context.Context, key string, field string) *redis.BoolCmd

func (*Client) HGet

func (m *Client) HGet(ctx context.Context, key string, field string) *redis.StringCmd

func (*Client) HGetAll

func (m *Client) HGetAll(ctx context.Context, key string) *redis.StringStringMapCmd

func (*Client) HIncrBy

func (m *Client) HIncrBy(ctx context.Context, key string, field string, incr int64) *redis.IntCmd

func (*Client) HIncrByFloat

func (m *Client) HIncrByFloat(ctx context.Context, key string, field string, incr float64) *redis.FloatCmd

func (*Client) HKeys

func (m *Client) HKeys(ctx context.Context, key string) *redis.StringSliceCmd

func (*Client) HLen

func (m *Client) HLen(ctx context.Context, key string) *redis.IntCmd

func (*Client) HMGet

func (m *Client) HMGet(ctx context.Context, key string, fields ...string) *redis.SliceCmd

func (*Client) HMSet

func (m *Client) HMSet(ctx context.Context, key string, fields map[string]interface{}) *redis.StatusCmd

func (*Client) HSet

func (m *Client) HSet(ctx context.Context, key string, field string, value interface{}) *redis.BoolCmd

func (*Client) HSetNX

func (m *Client) HSetNX(ctx context.Context, key string, field string, val interface{}) *redis.BoolCmd

func (*Client) HVals

func (m *Client) HVals(ctx context.Context, key string) *redis.StringSliceCmd

func (*Client) Incr

func (m *Client) Incr(ctx context.Context, key string) *redis.IntCmd

func (*Client) IncrBy

func (m *Client) IncrBy(ctx context.Context, key string, value int64) *redis.IntCmd

func (*Client) LIndex

func (m *Client) LIndex(ctx context.Context, key string, index int64) *redis.StringCmd

func (*Client) LInsert

func (m *Client) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *redis.IntCmd

func (*Client) LLen

func (m *Client) LLen(ctx context.Context, key string) *redis.IntCmd

func (*Client) LPop

func (m *Client) LPop(ctx context.Context, key string) *redis.StringCmd

func (*Client) LPush

func (m *Client) LPush(ctx context.Context, key string, values ...interface{}) *redis.IntCmd

func (*Client) LPushX

func (m *Client) LPushX(ctx context.Context, key string, value interface{}) *redis.IntCmd

func (*Client) LRange

func (m *Client) LRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd

func (*Client) LRem

func (m *Client) LRem(ctx context.Context, key string, count int64, value interface{}) *redis.IntCmd

func (*Client) LSet

func (m *Client) LSet(ctx context.Context, key string, index int64, value interface{}) *redis.StatusCmd

func (*Client) LTrim

func (m *Client) LTrim(ctx context.Context, key string, start, stop int64) *redis.StatusCmd

func (*Client) MGet

func (m *Client) MGet(ctx context.Context, keys ...string) *redis.SliceCmd

func (*Client) MSet

func (m *Client) MSet(ctx context.Context, pairs ...interface{}) *redis.StatusCmd

func (*Client) RPop

func (m *Client) RPop(ctx context.Context, key string) *redis.StringCmd

func (*Client) RPush

func (m *Client) RPush(ctx context.Context, key string, values ...interface{}) *redis.IntCmd

func (*Client) RPushX

func (m *Client) RPushX(ctx context.Context, key string, value interface{}) *redis.IntCmd

func (*Client) ScriptExists added in v1.3.35

func (m *Client) ScriptExists(ctx context.Context, scriptHash string) *redis.BoolSliceCmd

func (*Client) ScriptLoad added in v1.3.35

func (m *Client) ScriptLoad(ctx context.Context, script string) *redis.StringCmd

func (*Client) Set

func (m *Client) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd

func (*Client) SetBit

func (m *Client) SetBit(ctx context.Context, key string, offset int64, value int) *redis.IntCmd

func (*Client) SetNX

func (m *Client) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd

func (*Client) TTL

func (m *Client) TTL(ctx context.Context, key string) *redis.DurationCmd

func (*Client) ZAdd

func (m *Client) ZAdd(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd

func (*Client) ZAddCh

func (m *Client) ZAddCh(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd

func (*Client) ZAddNX

func (m *Client) ZAddNX(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd

func (*Client) ZAddNXCh

func (m *Client) ZAddNXCh(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd

func (*Client) ZAddXX

func (m *Client) ZAddXX(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd

func (*Client) ZAddXXCh

func (m *Client) ZAddXXCh(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd

func (*Client) ZCard

func (m *Client) ZCard(ctx context.Context, key string) *redis.IntCmd

func (*Client) ZCount

func (m *Client) ZCount(ctx context.Context, key, min, max string) *redis.IntCmd

func (*Client) ZIncr

func (m *Client) ZIncr(ctx context.Context, key string, member redis.Z) *redis.FloatCmd

func (*Client) ZIncrBy

func (m *Client) ZIncrBy(ctx context.Context, key string, increment float64, member string) *redis.FloatCmd

func (*Client) ZIncrNX

func (m *Client) ZIncrNX(ctx context.Context, key string, member redis.Z) *redis.FloatCmd

func (*Client) ZIncrXX

func (m *Client) ZIncrXX(ctx context.Context, key string, member redis.Z) *redis.FloatCmd

func (*Client) ZRange

func (m *Client) ZRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd

func (*Client) ZRangeByLex

func (m *Client) ZRangeByLex(ctx context.Context, key string, by redis.ZRangeBy) *redis.StringSliceCmd

func (*Client) ZRangeByScore

func (m *Client) ZRangeByScore(ctx context.Context, key string, by redis.ZRangeBy) *redis.StringSliceCmd

func (*Client) ZRangeWithScores

func (m *Client) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *redis.ZSliceCmd

func (*Client) ZRank

func (m *Client) ZRank(ctx context.Context, key string, member string) *redis.IntCmd

func (*Client) ZRem

func (m *Client) ZRem(ctx context.Context, key string, members []interface{}) *redis.IntCmd

func (*Client) ZRevRange

func (m *Client) ZRevRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd

func (*Client) ZRevRangeWithScores

func (m *Client) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *redis.ZSliceCmd

func (*Client) ZRevRank

func (m *Client) ZRevRank(ctx context.Context, key string, member string) *redis.IntCmd

func (*Client) ZScore

func (m *Client) ZScore(ctx context.Context, key string, member string) *redis.FloatCmd

type Config

type Config struct {
	// contains filtered or unexported fields
}

type Configer

type Configer interface {
	Init(ctx context.Context) error
	GetConfig(ctx context.Context, namespace string) (*Config, error)
	ParseKey(ctx context.Context, key string) (*KeyParts, error)
	Watch(ctx context.Context) <-chan *center.ChangeEvent
}
var DefaultConfiger Configer

func NewConfiger

func NewConfiger(configType constants.ConfigerType) (Configer, error)

func NewEtcdConfiger

func NewEtcdConfiger() Configer

func NewSimpleConfiger

func NewSimpleConfiger() Configer

type EtcdConfig

type EtcdConfig struct {
	// contains filtered or unexported fields
}

func (*EtcdConfig) GetConfig

func (m *EtcdConfig) GetConfig(ctx context.Context, namespace string) (*Config, error)

func (*EtcdConfig) Init

func (m *EtcdConfig) Init(ctx context.Context) error

func (*EtcdConfig) ParseKey

func (m *EtcdConfig) ParseKey(ctx context.Context, key string) (*KeyParts, error)

func (*EtcdConfig) Watch

func (m *EtcdConfig) Watch(ctx context.Context) <-chan *center.ChangeEvent

type InstanceConf

type InstanceConf struct {
	Group     string
	Namespace string
	Wrapper   string
}

func (*InstanceConf) String

func (m *InstanceConf) String() string

type InstanceManager

type InstanceManager struct {
	// contains filtered or unexported fields
}

func NewInstanceManager

func NewInstanceManager() *InstanceManager

func (*InstanceManager) Close

func (m *InstanceManager) Close()

func (*InstanceManager) GetInstance

func (m *InstanceManager) GetInstance(ctx context.Context, conf *InstanceConf) (*Client, error)

func (*InstanceManager) Watch

func (m *InstanceManager) Watch(ctx context.Context)

type KeyParts

type KeyParts struct {
	Namespace string
	Group     string
}

type SimpleConfig

type SimpleConfig struct {
}

func (*SimpleConfig) GetConfig

func (m *SimpleConfig) GetConfig(ctx context.Context, namespace string) (*Config, error)

func (*SimpleConfig) Init

func (m *SimpleConfig) Init(ctx context.Context) error

func (*SimpleConfig) ParseKey

func (m *SimpleConfig) ParseKey(ctx context.Context, key string) (*KeyParts, error)

func (*SimpleConfig) Watch

func (m *SimpleConfig) Watch(ctx context.Context) <-chan *center.ChangeEvent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL