redis

package
v0.0.0-...-04fb950 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Redis = new(redisConnector)

Functions

This section is empty.

Types

type ClusterOpt

type ClusterOpt func(o *ClusterOption)

func WithClusterAddress

func WithClusterAddress(address ...string) ClusterOpt

func WithClusterDB

func WithClusterDB(db int) ClusterOpt

func WithClusterPassword

func WithClusterPassword(password string) ClusterOpt

func WithClusterUser

func WithClusterUser(user string) ClusterOpt

func WithNodes

func WithNodes(nodes ...redis.ClusterNode) ClusterOpt

func WithRandom

func WithRandom(isRandom bool) ClusterOpt

type ClusterOption

type ClusterOption struct {
	Option
	Random   bool                `json:"random"`
	ReadOnly bool                `json:"read_only"`
	Nodes    []redis.ClusterNode `json:"nodes"`
}

type Opt

type Opt func(o *Option)

func WithAddress

func WithAddress(address ...string) Opt

func WithDB

func WithDB(db int) Opt

func WithPassword

func WithPassword(password string) Opt

func WithUser

func WithUser(user string) Opt

type Option

type Option struct {
	// Mode       string   `json:"mode"` // sample ,cluster,
	Address    []string `json:"address"`
	Password   string   `json:"password"`
	User       string   `json:"user"`
	DB         int      `json:"db"`
	PoolSize   int      `json:"pool_size"`
	MaxRetries int      `json:"max_retries"`
}

type UniversalOpt

type UniversalOpt func(o *UniversalOption)

func WithMaster

func WithMaster(master string) UniversalOpt

func WithUniversalAddress

func WithUniversalAddress(address ...string) UniversalOpt

type UniversalOption

type UniversalOption struct {
	ClusterOption
	Master string `json:"master"`
}

Jump to

Keyboard shortcuts

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