redis

package
v0.9.14 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	goredis.UniversalClient
	// contains filtered or unexported fields
}

Client

func New

func New(conf *Config) *Client

func (*Client) Connect

func (client *Client) Connect() error

Connect 单点连接

func (*Client) ConnectCluster

func (client *Client) ConnectCluster() error

ConnectCluster 连接集群

type Config

type Config struct {
	// host
	Host string

	// port, default 6379
	Port int

	// auth
	Auth string

	// pool size, default 100
	PoolSize int

	// max retries, default 3
	MaxRetries int

	// timeout, default 10 seconds
	IdleTimeout time.Duration

	// 集群
	Cluster string
}

Config Redis配置

func (*Config) ClusterOption

func (conf *Config) ClusterOption() *redis.ClusterOptions

ClusterOption 集群选项

func (*Config) Options

func (conf *Config) Options() *redis.Options

Options 单机选项

Jump to

Keyboard shortcuts

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