redis

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 单机选项

type Connection added in v1.0.0

type Connection interface {
	GetInstance() redis.UniversalClient
}

func Connect added in v1.0.0

func Connect(conf *Config) (Connection, error)

Jump to

Keyboard shortcuts

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