redis

package
v1.8.26 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Zlib Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter added in v1.1.23

type Adapter struct {
	// contains filtered or unexported fields
}

func NewAdapter added in v1.1.23

func NewAdapter(name string, cfg *config.RedisConfig, sentinelCfg *config.RedisConfig, clusterCfg *config.RedisConfig) (*Adapter, error)

func (*Adapter) Cluster added in v1.1.23

func (a *Adapter) Cluster() *redis.ClusterClient

func (*Adapter) Name added in v1.1.23

func (a *Adapter) Name() string

func (*Adapter) Rds added in v1.1.23

func (a *Adapter) Rds() *redis.Client

func (*Adapter) Sentinel added in v1.1.23

func (a *Adapter) Sentinel() *redis.SentinelClient

type Client

type Client interface {
	Get(name string) (Redis, error)
	Close(name string) error
	CloseAll()
	Select(name string)                    //选哪个redis
	SelectDB(name string, index int) error //选哪个redis db
}

func NewRedis

func NewRedis(conf []config.Redis) (Client, error)

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

func (*Connector) Close

func (c *Connector) Close(name string) error

func (*Connector) CloseAll

func (c *Connector) CloseAll()

func (*Connector) Get

func (c *Connector) Get(name string) (Redis, error)

func (*Connector) Select added in v0.4.1

func (c *Connector) Select(name string)

func (*Connector) SelectDB added in v0.4.6

func (c *Connector) SelectDB(name string, index int) error

type Logger added in v1.1.23

type Logger struct {
	config.RedisLogger
}

func (*Logger) Printf added in v1.1.23

func (l *Logger) Printf(ctx context.Context, format string, v ...interface{})

type Redis added in v1.1.23

type Redis interface {
	Rds() *redis.Client
	Sentinel() *redis.SentinelClient
	Cluster() *redis.ClusterClient
	Name() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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