redis

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Name string
	Args []interface{}
}

func Command

func Command(name string, args ...interface{}) *Cmd

type Endpoint

type Endpoint struct {
	Endpoint types.Endpoint `env:""`
	Wait     bool
	Prefix   string
	// contains filtered or unexported fields
}

func (*Endpoint) Exec

func (r *Endpoint) Exec(cmd *Cmd, others ...*Cmd) (interface{}, error)

func (*Endpoint) Get

func (r *Endpoint) Get() redis.Conn

func (*Endpoint) Init

func (r *Endpoint) Init()

func (*Endpoint) Key

func (r *Endpoint) Key(key string) string

func (*Endpoint) LivenessCheck

func (r *Endpoint) LivenessCheck() map[string]string

func (*Endpoint) SetDefault

func (r *Endpoint) SetDefault()

type Operator

type Operator interface {
	// Key returns key with prefix
	Key(key string) string
	// Get redis connection
	Get() redis.Conn
	// Exec to execute redis command
	Exec(cmd *Cmd, others ...*Cmd) (interface{}, error)
}

type Redis

type Redis struct {
	Protocol       string
	Host           string
	Port           int
	Password       types.Password
	ConnectTimeout types.Duration
	WriteTimeout   types.Duration
	ReadTimeout    types.Duration
	IdleTimeout    types.Duration
	MaxActive      int
	MaxIdle        int
	Wait           bool
	DB             int

	Prefix string
	// contains filtered or unexported fields
}

func (*Redis) Exec

func (r *Redis) Exec(cmd *Cmd, others ...*Cmd) (interface{}, error)

func (*Redis) Get

func (r *Redis) Get() redis.Conn

func (*Redis) Init

func (r *Redis) Init()

func (*Redis) Key

func (r *Redis) Key(key string) string

func (*Redis) LivenessCheck

func (r *Redis) LivenessCheck() map[string]string

func (*Redis) Name added in v1.1.0

func (r *Redis) Name() string

func (*Redis) SetDefault

func (r *Redis) SetDefault()

func (*Redis) WithDBIndex added in v1.0.0

func (r *Redis) WithDBIndex(n int) *Redis

func (*Redis) WithPrefix added in v1.0.0

func (r *Redis) WithPrefix(prefix string) *Redis

Jump to

Keyboard shortcuts

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