configs

package
v1.2.84 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 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 {
	InitAddress           []string       `json:"initAddress" yaml:"initAddress"`
	Addr                  []string       `json:"addr" yaml:"addr"`
	Username              string         `json:"username" yaml:"username"`
	Password              string         `json:"password" yaml:"password"`
	ClientName            string         `json:"clientName" yaml:"clientName"`
	ClientSetInfo         []string       `json:"clientSetInfo" yaml:"clientSetInfo"`
	ClientTrackingOptions []string       `json:"clientTrackingOptions" yaml:"clientTrackingOptions"`
	DB                    int            `json:"db" yaml:"db"`
	CacheSizeEachConn     int            `json:"cacheSizeEachConn" yaml:"cacheSizeEachConn"`
	RingScaleEachConn     int            `json:"ringScaleEachConn" yaml:"ringScaleEachConn"`
	ReadBufferEachConn    int            `json:"readBufferEachConn" yaml:"readBufferEachConn"`
	WriteBufferEachConn   int            `json:"writeBufferEachConn" yaml:"writeBufferEachConn"`
	BlockingPoolSize      int            `json:"blockingPoolSize" yaml:"blockingPoolSize"`
	PipelineMultiplex     int            `json:"pipelineMultiplex" yaml:"pipelineMultiplex"`
	ConnWriteTimeout      time.Duration  `json:"connWriteTimeout" yaml:"connWriteTimeout"`
	MaxFlushDelay         time.Duration  `json:"maxFlushDelay" yaml:"maxFlushDelay"`
	ShuffleInit           bool           `json:"shuffleInit" yaml:"shuffleInit"`
	ClientNoTouch         bool           `json:"clientNoTouch" yaml:"clientNoTouch"`
	DisableRetry          bool           `json:"disableRetry" yaml:"disableRetry"`
	DisableCache          bool           `json:"disableCache" yaml:"disableCache"`
	AlwaysPipelining      bool           `json:"alwaysPipelining" yaml:"alwaysPipelining"`
	AlwaysRESP2           bool           `json:"alwaysRESP2" yaml:"alwaysRESP2"`
	ForceSingleClient     bool           `json:"forceSingleClient" yaml:"forceSingleClient"`
	ReplicaOnly           bool           `json:"replicaOnly" yaml:"replicaOnly"`
	ClientNoEvict         bool           `json:"clientNoEvict" yaml:"clientNoEvict"`
	Sentinel              SentinelConfig `json:"sentinel" yaml:"sentinel"`
	SSL                   SSLConfig      `json:"ssl" yaml:"ssl"`
}

func (*Config) AsOption

func (config *Config) AsOption(options Options) (option rueidis.ClientOption, err error)

func (*Config) Make

func (config *Config) Make(options Options) (client rueidis.Client, err error)

type Option

type Option func(options *Options)

func WithDialFn

func WithDialFn(fn func(string, *net.Dialer, *tls.Config) (conn net.Conn, err error)) Option

func WithDialer

func WithDialer(dialer *net.Dialer) Option

func WithNewCacheStoreFn

func WithNewCacheStoreFn(fn rueidis.NewCacheStoreFn) Option

func WithSendToReplicas

func WithSendToReplicas(fn func(cmd rueidis.Completed) bool) Option

func WithSentinelDialer

func WithSentinelDialer(dialer *net.Dialer) Option

type Options

type Options struct {
	AuthCredentialsFn func(rueidis.AuthCredentialsContext) (rueidis.AuthCredentials, error)
	Dialer            *net.Dialer
	DialFn            func(string, *net.Dialer, *tls.Config) (conn net.Conn, err error)
	SentinelDialer    *net.Dialer
	SendToReplicas    func(cmd rueidis.Completed) bool
	NewCacheStoreFn   rueidis.NewCacheStoreFn
}

type SSLConfig

type SSLConfig struct {
	Enable bool `json:"enable"`
	configs.Client
}

type SentinelConfig

type SentinelConfig struct {
	Enable     bool      `json:"enable" yaml:"enable"`
	MasterSet  string    `json:"masterSet" yaml:"masterSet"`
	Username   string    `json:"username" yaml:"username"`
	Password   string    `json:"password" yaml:"password"`
	ClientName string    `json:"clientName" yaml:"clientName"`
	SSL        SSLConfig `json:"ssl" yaml:"ssl"`
}

Jump to

Keyboard shortcuts

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