Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type DB
- type Redis
- func (s *Redis) Close()
- func (s *Redis) Context() context.Context
- func (s *Redis) DB() redis.UniversalClient
- func (s *Redis) Lock(key string, timeout ...time.Duration) (bool, error)
- func (s *Redis) LockWithWaitting(ctx context.Context, key string, timeout ...time.Duration) error
- func (s *Redis) Namer(name string, subname ...string) string
- func (s *Redis) Prefix() string
- func (s *Redis) Unlock(key string) error
Constants ¶
Variables ¶
View Source
var ErrLockTimeout = errors.New("LockTimeout")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addresses []string `yaml:"address" json:"address" usage:"List of redis servers (127.0.0.1:6379). Default '127.0.0.1:6379'."` DB int `` /* 132-byte string literal not displayed */ Username string `yaml:"username" json:"username" usage:"Username is a user name for authentication."` Password string `yaml:"password" json:"password" usage:"Password is a password for authentication."` SentinelUsername string `yaml:"sentinel_username" json:"sentinel_username" usage:""` SentinelPassword string `yaml:"sentinel_password" json:"sentinel_password" usage:""` AllowSSL bool `yaml:"allow_ssl" json:"allow_ssl" usage:""` TLSServerName string `yaml:"tls_server_name" json:"tls_server_name" usage:""` TLSCert string `yaml:"tls_cert" json:"tls_cert" usage:""` TLSKey string `yaml:"tls_key" json:"tls_key" usage:""` MaxRetries int `yaml:"max_retries" json:"max_retries" usage:""` MinRetryBackoff int `yaml:"min_retry_backoff" json:"min_retry_backoff" usage:""` MaxRetryBackoff int `yaml:"max_retry_backoff" json:"max_retry_backoff" usage:""` DialTimeout int `yaml:"dial_timeout" json:"dial_timeout" usage:""` ReadTimeout int `yaml:"read_timeout" json:"read_timeout" usage:""` WriteTimeout int `yaml:"write_timeout" json:"write_timeout" usage:""` ContextTimeoutEnabled bool `yaml:"context_timeout_enabled" json:"context_timeout_enabled" usage:""` PoolFIFO bool `yaml:"pool_fifo" json:"pool_fifo" usage:"PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO)."` PoolSize int `yaml:"pool_size" json:"pool_size" usage:""` PoolTimeout int `yaml:"pool_timeout" json:"pool_timeout" usage:""` MinIdleConns int `yaml:"min_idle_conns" json:"min_idle_conns" usage:""` MaxIdleConns int `yaml:"max_idle_conns" json:"max_idle_conns" usage:""` ConnMaxIdleTime int `yaml:"conn_max_idle_time" json:"conn_max_idle_time" usage:""` ConnMaxLifetime int `yaml:"conn_max_life_time" json:"conn_max_life_time" usage:""` MaxRedirects int `yaml:"max_redirects" json:"max_redirects" usage:"Only cluster clients."` ReadOnly bool `yaml:"read_only" json:"read_only" usage:"Only cluster clients."` RouteByLatency bool `yaml:"route_by_latency" json:"route_by_latency" usage:"Only cluster clients."` RouteRandomly bool `yaml:"route_randomly" json:"route_randomly" usage:"Only cluster clients."` MasterName string `yaml:"master_name" json:"master_name" usage:"The sentinel master name.Only failover clients."` Prefix string `yaml:"prefix" json:"prefix" usage:"Prefix."` }
type DB ¶
type DB interface { Close() Context() context.Context DB() redis.UniversalClient Prefix() string Namer(name string, subname ...string) string Lock(key string, timeout ...time.Duration) (bool, error) LockWithWaitting(ctx context.Context, key string, timeout ...time.Duration) error Unlock(key string) error }
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func (*Redis) LockWithWaitting ¶
Click to show internal directories.
Click to hide internal directories.