advredis

package
v0.0.0-...-575c38c Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPrefix = "redis"
)

Variables

This section is empty.

Functions

func Load

func Load(ctx context.Context, ld advconf.Loader, keys ...string) (client *redis.Client, err error)

func LoadCluster

func LoadCluster(ctx context.Context, ld advconf.Loader, keys ...string) (client *redis.ClusterClient, err error)

Types

type TracingHook

type TracingHook struct {
	Instance string
}

func (*TracingHook) AfterProcess

func (h *TracingHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error

func (*TracingHook) AfterProcessPipeline

func (h *TracingHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error

func (*TracingHook) BeforeProcess

func (h *TracingHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)

func (*TracingHook) BeforeProcessPipeline

func (h *TracingHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)

type UnifiedRedisOptions

type UnifiedRedisOptions struct {
	Network            string           `json:"network" default:"tcp"`
	Addresses          []string         `json:"addresses"`        // cluster only
	MaxRedirects       int              `json:"max-redirects"`    // cluster only
	ReadOnly           bool             `json:"read-only"`        // cluster only
	RouteByLatency     bool             `json:"route-by-latency"` // cluster only
	RouteRandomly      bool             `json:"route-randomly"`   // cluster only
	Address            string           `json:"address" default:"127.0.0.1:6379"`
	Database           int              `json:"database"`
	Username           string           `json:"username"`
	Password           string           `json:"password"`
	MaxRetries         int              `json:"max-retries"`
	MinRetryBackoff    advconf.Duration `json:"min-retry-backoff"`
	MaxRetryBackoff    advconf.Duration `json:"max-retry-backoff"`
	DialTimeout        advconf.Duration `json:"dial-timeout"`
	ReadTimeout        advconf.Duration `json:"read-timeout"`
	WriteTimeout       advconf.Duration `json:"write-timeout"`
	PoolSize           int              `json:"pool-size"`
	MinIdleConns       int              `json:"min-idle-conns"`
	MaxConnAge         advconf.Duration `json:"max-conn-age"`
	PoolTimeout        advconf.Duration `json:"pool-timeout"`
	IdleTimeout        advconf.Duration `json:"idle-timeout"`
	IdleCheckFrequency advconf.Duration `json:"idle-check-frequency"`
}

func (UnifiedRedisOptions) UnwrapRedisClusterOptions

func (opts UnifiedRedisOptions) UnwrapRedisClusterOptions() *redis.ClusterOptions

func (UnifiedRedisOptions) UnwrapRedisOptions

func (opts UnifiedRedisOptions) UnwrapRedisOptions() *redis.Options

Jump to

Keyboard shortcuts

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