v3

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNil         = goredis.Nil
	ErrInvalidType = errors.New("redis: invalid type")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Close() error
	Check(context.Context) health.Status
	Stats() redis.PoolStats
	Scan(cursor uint64, key string, count int64) (uint64, []string, error)
	Get(key string) ([]byte, error)
	GetMulti(keys []string) ([]interface{}, error)
	Set(key string, val interface{}, expiration time.Duration) error
	PFAdd(key string, els []string) (int64, error)
	PFCount(keys ...string) (int64, error)
	IncrByFloat(key string, value float64) (float64, error)
	Del(key string) error
}

func NewClient

func NewClient(addr string, opts ...Option) (Client, error)

type Option

type Option func(*options)

func WithDialTimeout

func WithDialTimeout(dialTimeout time.Duration) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

func WithMetrics

func WithMetrics(r metrics.Registerer) Option

func WithMinIdleConns

func WithMinIdleConns(minIdleConns int) Option

func WithPassword

func WithPassword(password string) Option

func WithPoolSize

func WithPoolSize(poolSize int) Option

func WithPoolTimeout

func WithPoolTimeout(poolTimeout time.Duration) Option

func WithServerName

func WithServerName(serverName string) Option

Jump to

Keyboard shortcuts

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