Documentation ¶
Index ¶
- Constants
- func ConfigAdd(path string)
- func NewClient(ctx context.Context, plugins ...Plugin) (*redis.Client, error)
- func NewClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*redis.Client, error)
- func NewClientWithOptions(ctx context.Context, o *Options, plugins ...Plugin) (client *redis.Client, err error)
- func NewClusterClient(ctx context.Context, plugins ...ClusterPlugin) (*redis.ClusterClient, error)
- func NewClusterClientWithConfigPath(ctx context.Context, path string, plugins ...ClusterPlugin) (*redis.ClusterClient, error)
- func NewClusterClientWithOptions(ctx context.Context, o *Options, plugins ...ClusterPlugin) (client *redis.ClusterClient, err error)
- type ClientOptions
- type ClusterOptions
- type ClusterPlugin
- type ManagedClient
- func NewManagedClient(ctx context.Context, plugins ...Plugin) (*ManagedClient, error)
- func NewManagedClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*ManagedClient, error)
- func NewManagedClientWithOptions(ctx context.Context, opts *Options, plugins ...Plugin) (*ManagedClient, error)
- type ManagedClusterClient
- func NewManagedClusterClient(ctx context.Context, plugins ...ClusterPlugin) (*ManagedClusterClient, error)
- func NewManagedClusterClientWithConfigPath(ctx context.Context, path string, plugins ...ClusterPlugin) (*ManagedClusterClient, error)
- func NewManagedClusterClientWithOptions(ctx context.Context, opts *Options, plugins ...ClusterPlugin) (*ManagedClusterClient, error)
- type Options
- type Plugin
- type SentinelOptions
Constants ¶
const (
PluginsRoot = root + ".plugins"
)
Variables ¶
This section is empty.
Functions ¶
func NewClientWithConfigPath ¶
func NewClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*redis.Client, error)
NewClientWithConfigPath returns a new redis client with options from config path.
func NewClientWithOptions ¶
func NewClientWithOptions(ctx context.Context, o *Options, plugins ...Plugin) (client *redis.Client, err error)
NewClientWithOptions returns a new redis client with options.
func NewClusterClient ¶
func NewClusterClient(ctx context.Context, plugins ...ClusterPlugin) (*redis.ClusterClient, error)
NewClusterClient returns a new ClusterClient.
func NewClusterClientWithConfigPath ¶
func NewClusterClientWithConfigPath(ctx context.Context, path string, plugins ...ClusterPlugin) (*redis.ClusterClient, error)
NewClusterClientWithConfigPath returns a new ClusterClient with options from config path.
func NewClusterClientWithOptions ¶
func NewClusterClientWithOptions(ctx context.Context, o *Options, plugins ...ClusterPlugin) (client *redis.ClusterClient, err error)
NewClusterClientWithOptions returns a new ClusterClient with options.
Types ¶
type ClientOptions ¶
ClientOptions represents the redis client options.
type ClusterOptions ¶
type ClusterOptions struct { Addrs []string MaxRedirects int ReadOnly bool RouteByLatency bool RouteRandomly bool }
ClusterOptions represents a redis cluster client options.
type ClusterPlugin ¶
ClusterPlugin represents a redis cluster plugin func signature.
type ManagedClient ¶
ManagedClient represents a redis managed client.
func NewManagedClient ¶
func NewManagedClient(ctx context.Context, plugins ...Plugin) (*ManagedClient, error)
NewManagedClient returns a new managed client with default options.
func NewManagedClientWithConfigPath ¶
func NewManagedClientWithConfigPath(ctx context.Context, path string, plugins ...Plugin) (*ManagedClient, error)
NewManagedClientWithConfigPath returns a new managed client with options from config path.
func NewManagedClientWithOptions ¶
func NewManagedClientWithOptions(ctx context.Context, opts *Options, plugins ...Plugin) (*ManagedClient, error)
NewManagedClientWithOptions returns a new managed client with options.
type ManagedClusterClient ¶
type ManagedClusterClient struct { Client *redis.ClusterClient Plugins []ClusterPlugin Options *Options }
ManagedClusterClient represents a redis cluster managed client.
func NewManagedClusterClient ¶
func NewManagedClusterClient(ctx context.Context, plugins ...ClusterPlugin) (*ManagedClusterClient, error)
NewManagedClusterClient returns a new managed client with default options.
func NewManagedClusterClientWithConfigPath ¶
func NewManagedClusterClientWithConfigPath(ctx context.Context, path string, plugins ...ClusterPlugin) (*ManagedClusterClient, error)
NewManagedClusterClientWithConfigPath returns a new managed client with options from config path.
func NewManagedClusterClientWithOptions ¶
func NewManagedClusterClientWithOptions(ctx context.Context, opts *Options, plugins ...ClusterPlugin) (*ManagedClusterClient, error)
NewManagedClusterClientWithOptions returns a new managed client with options.
type Options ¶
type Options struct { Sentinel SentinelOptions Password string MaxRetries int MinRetryBackoff time.Duration MaxRetryBackoff time.Duration DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int MinIdleConns int MaxConnAge time.Duration PoolTimeout time.Duration IdleTimeout time.Duration IdleCheckFrequency time.Duration Client ClientOptions Cluster ClusterOptions }
Options represents redis client set options.
func NewOptions ¶
NewOptions returns options from config file or environment vars.
func NewOptionsWithPath ¶
NewOptionsWithPath unmarshals options based a given key path.
type SentinelOptions ¶
SentinelOptions represents redis sentinel options.