redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string) error

Delete delete key

func Deletes

func Deletes(key string) error

Deletes delete keys

func Exist

func Exist(key string) (bool, error)

Exist check exist key

func Get

func Get(key string) ([]byte, error)

Get get key

func GetKeyWithPrefix added in v0.1.3

func GetKeyWithPrefix(prefix string, key string) string

GetKeyWithPrefix return key with prefix

func Incr

func Incr(key string) (int, error)

Incr incr by key

func IncrBy

func IncrBy(key string, value int) (int, error)

IncrBy incr by key set special value

func Ping

func Ping() error

Ping check ping

func Set

func Set(key string, value []byte, seconds int) error

Set set key with expires

func SetExpires

func SetExpires(key string, seconds int)

SetExpires set key expires

func Setup

func Setup()

Setup init redis

Types

type Configure added in v0.1.1

type Configure struct {
	Mode      string `env:"APP_MODE" envDefault:"debug"`
	Host      string `env:"REDIS_HOST" envDefault:"localhost"`
	Port      string `env:"REDIS_PORT" envDefault:"6379"`
	Password  string `env:"REDIS_PASSWORD" envDefault:"XNwsLoa..."`
	Database  int    `env:"REDIS_DATABASE" envDefault:"1"`
	MaxIdle   int    `env:"REDIS_MAX_IDLE" envDefault:"20"`
	MaxActive int    `env:"REDIS_MAX_ACTIVE" envDefault:"10"`
}

Configure config for redis

var Config Configure

Config global defined redis config

Jump to

Keyboard shortcuts

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