redis

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package redis provides implementation of Go API for redis interface

Index

Constants

This section is empty.

Variables

View Source
var (
	Nil = redis.Nil
)

Functions

This section is empty.

Types

type Conn

type Conn = redis.Conn

type Deleter

type Deleter interface {
	Del(keys ...string) *redis.IntCmd
}

type Getter

type Getter interface {
	Get(string) *redis.StringCmd
	MGet(...string) *redis.SliceCmd
}

type IntCmd

type IntCmd = redis.IntCmd

type Lister

type Lister interface {
}

type Option

type Option func(*redisClient) error

func WithAddrs

func WithAddrs(addrs ...string) Option

func WithClusterSlots

func WithClusterSlots(f func() ([]redis.ClusterSlot, error)) Option

func WithDB

func WithDB(db int) Option

func WithDialTimeout

func WithDialTimeout(dur string) Option

func WithDialer

func WithDialer(der func(ctx context.Context, addr, port string) (net.Conn, error)) Option

func WithIdleCheckFrequency

func WithIdleCheckFrequency(dur string) Option

func WithIdleTimeout

func WithIdleTimeout(dur string) Option

func WithInitialPingDuration

func WithInitialPingDuration(dur string) Option

func WithInitialPingTimeLimit

func WithInitialPingTimeLimit(lim string) Option

func WithKeyPrefix

func WithKeyPrefix(prefix string) Option

func WithMaximumConnectionAge

func WithMaximumConnectionAge(dur string) Option

func WithMaximumRetryBackoff

func WithMaximumRetryBackoff(dur string) Option

func WithMinimumIdleConnection

func WithMinimumIdleConnection(minIdleConns int) Option

func WithMinimumRetryBackoff

func WithMinimumRetryBackoff(dur string) Option

func WithOnConnectFunction

func WithOnConnectFunction(f func(*redis.Conn) error) Option

func WithOnNewNodeFunction

func WithOnNewNodeFunction(f func(*redis.Client)) Option

func WithPassword

func WithPassword(password string) Option

func WithPoolSize

func WithPoolSize(poolSize int) Option

func WithPoolTimeout

func WithPoolTimeout(dur string) Option

func WithReadOnlyFlag

func WithReadOnlyFlag(readOnly bool) Option

func WithReadTimeout

func WithReadTimeout(dur string) Option

func WithRedirectLimit

func WithRedirectLimit(maxRedirects int) Option

func WithRetryLimit

func WithRetryLimit(maxRetries int) Option

func WithRouteByLatencyFlag

func WithRouteByLatencyFlag(routeByLatency bool) Option

func WithRouteRandomlyFlag

func WithRouteRandomlyFlag(routeRandomly bool) Option

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

func WithWriteTimeout

func WithWriteTimeout(dur string) Option

type Redis

type Redis interface {
	TxPipeline() redis.Pipeliner
	Ping() *StatusCmd
	Close() error
	Lister
	Getter
	Setter
	Deleter
}

func New

func New(ctx context.Context, opts ...Option) (rc Redis, err error)

type Setter

type Setter interface {
}

type StatusCmd

type StatusCmd = redis.StatusCmd

type StringCmd

type StringCmd = redis.StringCmd

Jump to

Keyboard shortcuts

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