redis

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNil when key does not exist.
	ErrNil = redisv8.Nil
)

Functions

func Client added in v0.0.6

func Client() *redisv8.Client

func Get

func Get() *redisv8.Client

Get returns the handler to operate redis if success

func Valid

func Valid() bool

Valid returns a bool valud to determine whether the connection is ready to use

Types

type Option

type Option struct {
	Address  string `json:"address"`
	DB       int    `json:"db"`
	Username string `json:"username"`
	Password string `json:"password"`
	Port     int    `json:"port"`
	Network  string `json:"network"`
	// Maximum number of retries before giving up.
	// Default is 3 retries; -1 (not 0) disables retries.
	MaxRetries int `json:"max_retries"`
}

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func New

func New() *Redis

func (*Redis) Connect

func (r *Redis) Connect() error

func (*Redis) Destory

func (r *Redis) Destory()

func (*Redis) Load

func (r *Redis) Load(src []byte) error

func (Redis) Name added in v0.0.6

func (r Redis) Name() string

Jump to

Keyboard shortcuts

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