storage

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilRedis not init redis client
	ErrNilRedis = errors.New("redis not found")
)
View Source
var (
	// ErrorCacheMiss 缓存 miss,缓存中不存在该值
	ErrorCacheMiss = errors.New("cache miss")
)

Functions

This section is empty.

Types

type Redis

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

Redis redis storage

func NewRedis

func NewRedis(client *redis.Client) *Redis

NewRedis return a new redis storage

func (*Redis) Get

func (r *Redis) Get(key string) ([]byte, error)

Get redis GET

func (*Redis) Set

func (r *Redis) Set(key string, value []byte, expiration time.Duration) error

Set redis SET

Jump to

Keyboard shortcuts

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