redis

package
v0.0.0-...-70c2af6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStore

type RedisStore struct {
	RedisClient *redis.Client
}

RedisStore store http response in redis

func NewRedisStore

func NewRedisStore(redisClient *redis.Client) *RedisStore

NewRedisStore create a redis memory store with redis client

func (*RedisStore) Delete

func (store *RedisStore) Delete(key string) error

Delete remove key in redis, do nothing if key doesn't exist

func (*RedisStore) Get

func (store *RedisStore) Get(key string, value interface{}) error

Get get key in redis, if key doesn't exist, return ErrCacheMiss

func (*RedisStore) Set

func (store *RedisStore) Set(key string, value interface{}, expire time.Duration) error

Set put key value pair to redis, and expire after expireDuration

Jump to

Keyboard shortcuts

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