redis

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string) error

Delete 删除

func Expire

func Expire(key string, t int64) error

Expire 失效时间配置

func Get

func Get(key string) interface{}

Get 获取一个值

func GetBytes

func GetBytes(key *string) (*[]byte, error)

GetBytes 获取一个字节数组值

func Init

func Init(opts *Config) error

Init init

func IsExist

func IsExist(key string) bool

IsExist 判断key是否存在

func Set

func Set(key string, val interface{}, timeout time.Duration) (err error)

Set 设置一个值

Types

type Config

type Config struct {
	Host        string `yml:"host" json:"host"`
	Password    string `yml:"password" json:"password"`
	Database    int    `yml:"database" json:"database"`
	MaxIdle     int    `yml:"max_idle" json:"max_idle"`
	MaxActive   int    `yml:"max_active" json:"max_active"`
	IdleTimeout int    `yml:"idle_timeout" json:"idle_timeout"` //second
}

Config 配置

Jump to

Keyboard shortcuts

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