Documentation ¶
Index ¶
- Constants
- func ClientHasJSONSupport(c RedisClient) bool
- func GetServerVersion(c RedisClient) (string, error)
- func ParseClientFromProperties(properties map[string]string, defaultSettings *Settings) (client RedisClient, settings *Settings, err error)
- type Duration
- type Metadata
- type RedisClient
- type RedisError
- type RedisPipeliner
- type RedisXMessage
- type RedisXPendingExt
- type RedisXStream
- type Settings
Constants ¶
View Source
const ( ClusterType = "cluster" NodeType = "node" )
Variables ¶
This section is empty.
Functions ¶
func ClientHasJSONSupport ¶ added in v1.10.1
func ClientHasJSONSupport(c RedisClient) bool
func GetServerVersion ¶ added in v1.10.1
func GetServerVersion(c RedisClient) (string, error)
Types ¶
type Duration ¶
func (*Duration) DecodeString ¶
type Metadata ¶ added in v1.8.0
type RedisClient ¶ added in v1.10.1
type RedisClient interface { GetNilValueError() RedisError Context() context.Context DoRead(ctx context.Context, args ...interface{}) (interface{}, error) DoWrite(ctx context.Context, args ...interface{}) error Del(ctx context.Context, keys ...string) error Get(ctx context.Context, key string) (string, error) Close() error PingResult(ctx context.Context) (string, error) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (*bool, error) EvalInt(ctx context.Context, script string, keys []string, args ...interface{}) (*int, error, error) XAdd(ctx context.Context, stream string, maxLenApprox int64, values map[string]interface{}) (string, error) XGroupCreateMkStream(ctx context.Context, stream string, group string, start string) error XAck(ctx context.Context, stream string, group string, messageID string) error XReadGroupResult(ctx context.Context, group string, consumer string, streams []string, count int64, block time.Duration) ([]RedisXStream, error) XPendingExtResult(ctx context.Context, stream string, group string, start string, end string, count int64) ([]RedisXPendingExt, error) XClaimResult(ctx context.Context, stream string, group string, consumer string, minIdleTime time.Duration, messageIDs []string) ([]RedisXMessage, error) TxPipeline() RedisPipeliner TTLResult(ctx context.Context, key string) (time.Duration, error) }
func ClientFromV8Client ¶ added in v1.10.1
func ClientFromV8Client(client v8.UniversalClient) RedisClient
type RedisError ¶ added in v1.10.1
type RedisError string
func (RedisError) Error ¶ added in v1.10.1
func (e RedisError) Error() string
func (RedisError) RedisError ¶ added in v1.10.1
func (RedisError) RedisError()
type RedisPipeliner ¶ added in v1.10.1
type RedisXMessage ¶ added in v1.10.1
type RedisXPendingExt ¶ added in v1.10.1
type RedisXStream ¶ added in v1.10.1
type RedisXStream struct { Stream string Messages []RedisXMessage }
type Settings ¶
type Settings struct { // The Redis host Host string `mapstructure:"redisHost"` // The Redis password Password string `mapstructure:"redisPassword"` // The Redis username Username string `mapstructure:"redisUsername"` // Database to be selected after connecting to the server. DB int `mapstructure:"redisDB"` // The redis type node or cluster RedisType string `mapstructure:"redisType"` // Maximum number of retries before giving up. // A value of -1 (not 0) disables retries // Default is 3 retries RedisMaxRetries int `mapstructure:"redisMaxRetries"` // Minimum backoff between each retry. // Default is 8 milliseconds; -1 disables backoff. RedisMinRetryInterval Duration `mapstructure:"redisMinRetryInterval"` // Maximum backoff between each retry. // Default is 512 milliseconds; -1 disables backoff. RedisMaxRetryInterval Duration `mapstructure:"redisMaxRetryInterval"` // Dial timeout for establishing new connections. DialTimeout Duration `mapstructure:"dialTimeout"` // Timeout for socket reads. If reached, commands will fail // with a timeout instead of blocking. Use value -1 for no timeout and 0 for default. ReadTimeout Duration `mapstructure:"readTimeout"` // Timeout for socket writes. If reached, commands will fail WriteTimeout Duration `mapstructure:"writeTimeout"` // Maximum number of socket connections. PoolSize int `mapstructure:"poolSize"` // Minimum number of idle connections which is useful when establishing // new connection is slow. MinIdleConns int `mapstructure:"minIdleConns"` // Connection age at which client retires (closes) the connection. // Default is to not close aged connections. MaxConnAge Duration `mapstructure:"maxConnAge"` // Amount of time client waits for connection if all connections // are busy before returning an error. // Default is ReadTimeout + 1 second. PoolTimeout Duration `mapstructure:"poolTimeout"` // Amount of time after which client closes idle connections. // Should be less than server's timeout. // Default is 5 minutes. -1 disables idle timeout check. IdleTimeout Duration `mapstructure:"idleTimeout"` // Frequency of idle checks made by idle connections reaper. // Default is 1 minute. -1 disables idle connections reaper, // but idle connections are still discarded by the client // if IdleTimeout is set. IdleCheckFrequency Duration `mapstructure:"idleCheckFrequency"` // The master name SentinelMasterName string `mapstructure:"sentinelMasterName"` // Use Redis Sentinel for automatic failover. Failover bool `mapstructure:"failover"` // A flag to enables TLS by setting InsecureSkipVerify to true EnableTLS bool `mapstructure:"enableTLS"` }
Click to show internal directories.
Click to hide internal directories.