redis

package
v0.0.0-...-9dac4f2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: BSD-2-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracingHook

func NewTracingHook() redis.Hook

NewTracingHook creates a new go-redis hook instance and that will collect spans using the provided tracer.

Types

type Config

type Config struct {
	Network           string `json:"network,omitempty"`
	Addr              string `json:"addr,omitempty"`
	ConnectionTimeout int64  `json:"connection_timeout,omitempty"`
	ReadTimeout       int64  `json:"read_timeout,omitempty"`
	WriteTimeout      int64  `json:"write_timeout,omitempty"`
	Password          string `json:"password,omitempty"`
	DB                int32  `json:"DB,omitempty"`
	MaxIdle           int32  `json:"max_idle,omitempty"`
	MaxActive         int32  `json:"max_active,omitempty"`
	TestOnBorrow      bool   `json:"test_on_borrow,omitempty"`
	IdleTimeout       int32  `json:"idle_timeout,omitempty"`
	Wait              bool   `json:"wait,omitempty"`
}

Config Redis配置

func (*Config) GetAddr

func (x *Config) GetAddr() string

func (*Config) GetConnectionTimeout

func (x *Config) GetConnectionTimeout() int64

func (*Config) GetDB

func (x *Config) GetDB() int32

func (*Config) GetIdleTimeout

func (x *Config) GetIdleTimeout() int32

func (*Config) GetMaxActive

func (x *Config) GetMaxActive() int32

func (*Config) GetMaxIdle

func (x *Config) GetMaxIdle() int32

func (*Config) GetNetwork

func (x *Config) GetNetwork() string

func (*Config) GetPassword

func (x *Config) GetPassword() string

func (*Config) GetReadTimeout

func (x *Config) GetReadTimeout() int64

func (*Config) GetTestOnBorrow

func (x *Config) GetTestOnBorrow() bool

func (*Config) GetWait

func (x *Config) GetWait() bool

func (*Config) GetWriteTimeout

func (x *Config) GetWriteTimeout() int64

type IRedis

type IRedis interface {
	Execute(ctx context.Context, commands ...func(ctx context.Context, client *redis.Client) error) error
}

func NewRedis

func NewRedis(rc *Config, log log.Logger) (IRedis, func(), error)

Jump to

Keyboard shortcuts

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