cache

package
v0.0.0-...-30a366f Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(keys ...string) error

func Expire

func Expire(key string, expiration time.Duration) error

func ExpireAt

func ExpireAt(key string, tm time.Time) error

func Get

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

func HDel

func HDel(key string, fields []string) error

func HExists

func HExists(key, field string) (has bool, err error)

func HGet

func HGet(key, field string) (value interface{}, err error)

func HKeys

func HKeys(key string) ([]string, error)

func HSet

func HSet(key string, item map[string]interface{}) error

func HasKey

func HasKey(key string) bool

func InitRds

func InitRds(rdCFG RedisCfg)

func Set

func Set(key string, value interface{}, duration time.Duration) error

Set value 传地址

func SetX

func SetX(key string, value interface{}, expiration time.Duration) error

SetX Redis `SET key value [expiration] NX` command.

Zero expiration means the key has no expiration time.

Types

type RedisCfg

type RedisCfg struct {
	Use      bool   `json:"use"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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