Documentation
¶
Overview ¶
Based on `github.com/go-redis/redis`v6.6.0
Index ¶
- Constants
- func IsRedisNil(err error) bool
- type BoolCmd
- type BoolSliceCmd
- type Client
- type ClusterConfig
- type ClusterSlotsCmd
- type Cmdable
- type Cmder
- type Config
- type DurationCmd
- type FloatCmd
- type GeoLocation
- type GeoRadiusQuery
- type IntCmd
- type Message
- type Module
- type Pipeliner
- type PubSub
- type RedisCmdable
- type ScanCmd
- type SingleConfig
- type SliceCmd
- type StatusCmd
- type StringCmd
- type StringIntMapCmd
- type StringSliceCmd
- type StringStringMapCmd
- type Z
- type ZRangeBy
- type ZSliceCmd
Constants ¶
const ( DeploySingle string = "single" DeployCluster string = "cluster" )
redis deploy type
const Nil = redis.Nil
Redis nil reply, .e.g. when key does not exist.
Variables ¶
This section is empty.
Functions ¶
func IsRedisNil ¶
IsRedisNil Is the redis nil reply? .e.g. when key does not exist.
Types ¶
type BoolSliceCmd ¶
type BoolSliceCmd = redis.BoolSliceCmd
Client redis client and cluster client merge.
type Client ¶
type Client struct { Cmdable // contains filtered or unexported fields }
Client redis client and cluster client merge.
type ClusterConfig ¶
type ClusterConfig struct { // A seed list of host:port addresses of cluster nodes. Addrs []string `yaml:"addrs"` // The maximum number of retries before giving up. Command is retried // on network errors and MOVED/ASK redirects. // Default is 16. MaxRedirects int `yaml:"max_redirects,omitempty"` // Enables routing read-only queries to the closest master or slave node. RouteByLatency bool `yaml:"route_by_latency,omitempty"` }
ClusterConfig redis cluster client config.
type ClusterSlotsCmd ¶
type ClusterSlotsCmd = redis.ClusterSlotsCmd
Client redis client and cluster client merge.
type Cmdable ¶
type Cmdable interface { redis.Cmdable TxPipeline() redis.Pipeliner TxPipelined(fn func(redis.Pipeliner) error) ([]redis.Cmder, error) Publish(channel, message string) *redis.IntCmd Subscribe(channels ...string) *redis.PubSub }
Client redis client and cluster client merge.
type Config ¶
type Config struct { // redis deploy type, [single, cluster] DeployType string `yaml:"deploy_type"` // only for single node config, valid when DeployType=single. ForSingle SingleConfig `yaml:"for_single"` // only for cluster config, valid when DeployType=cluster. ForCluster ClusterConfig `yaml:"for_cluster"` // An optional password. Must match the password specified in the // requirepass server configuration option. Password string `yaml:"password,omitempty"` // The maximum number of retries before giving up. // Default is to not retry failed commands. MaxRetries int `yaml:"max_retries,omitempty"` // Dial timeout for establishing new connections. // Default is 5 seconds. DialTimeout int64 `yaml:"dial_timeout,omitempty"` // Timeout for socket reads. If reached, commands will fail // with a timeout instead of blocking. // Default is 3 seconds. ReadTimeout int64 `yaml:"read_timeout,omitempty"` // Timeout for socket writes. If reached, commands will fail // with a timeout instead of blocking. // Default is ReadTimeout. WriteTimeout int64 `yaml:"write_timeout,omitempty"` // PoolSizePerNode applies per cluster node and not for the whole cluster. // Maximum number of socket connections. // Default is 10 connections per every CPU as reported by runtime.NumCPU. PoolSizePerNode int `yaml:"pool_size_per_node"` // Amount of time client waits for connection if all connections // are busy before returning an error. // Default is ReadTimeout + 1 second. PoolTimeout int64 `yaml:"pool_timeout,omitempty"` // Amount of time after which client closes idle connections. // Should be less than server's timeout. // Default is 300 seconds. IdleTimeout int64 `yaml:"idle_timeout"` // Frequency of idle checks. // Default is 60 seconds. // When minus value is set, then idle check is disabled. IdleCheckFrequency int64 `yaml:"idle_check_frequency,omitempty"` // Enables read only queries on slave nodes. // Only for cluster. ReadOnly bool `yaml:"read_only,omitempty"` }
Config redis and cluster client config
type DurationCmd ¶
type DurationCmd = redis.DurationCmd
Client redis client and cluster client merge.
type GeoLocation ¶
type GeoLocation = redis.GeoLocation
Client redis client and cluster client merge.
type GeoRadiusQuery ¶
type GeoRadiusQuery = redis.GeoRadiusQuery
Client redis client and cluster client merge.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module
func (*Module) SetModuleString ¶
SetModuleString
type SingleConfig ¶
type SingleConfig struct { // host:port and address. Addr string `yaml:"addr"` // Maximum backoff between each retry. // Default is 512 seconds; -1 disables backoff. MaxRetryBackoff int64 `yaml:"max_retry_backoff,omitempty"` }
SingleConfig redis single node client config.
type StringIntMapCmd ¶
type StringIntMapCmd = redis.StringIntMapCmd
Client redis client and cluster client merge.
type StringSliceCmd ¶
type StringSliceCmd = redis.StringSliceCmd
Client redis client and cluster client merge.
type StringStringMapCmd ¶
type StringStringMapCmd = redis.StringStringMapCmd
Client redis client and cluster client merge.