cache

package
v0.0.0-...-c5f9841 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package cache implement a cache which backend by redis

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string) error

Synonyms of Redis DEL command Delete delete a key-value

func Exists

func Exists(key string) bool

Synonyms of Redis EXISTS command Check the whether key-value existed.

func Expire

func Expire(k string, expire int) error

Synonyms of Redis EXPIRE command Expire set a key-value pair's expired time( by second)

func Get

func Get(key string) (interface{}, error)

Synonyms of Redis GET command Get get the value by key

func IncrKey

func IncrKey(key string) (int, error)

func Int

func Int(key string) (int, error)

func MustBootUp

func MustBootUp(logger log.Logger, addr string) types.Closer

MustBootUp boot up a shard cache, it will panic if failed

func Set

func Set(k string, v interface{}) error

Synonyms of Redis SET command

func SetExpire

func SetExpire(k string, v interface{}, expire uint32) error

Synonyms of Redis SETEX command save a key-value pair with expired time( by second)

func SetStruct

func SetStruct(k string, v interface{}) error

func SetStructExpire

func SetStructExpire(k string, v interface{}, expire int) error

func String

func String(key string) (string, error)

func Struct

func Struct(token string, v interface{}) error

func TTL

func TTL(key string) (int, error)

Synonyms of Redis TTL command TTL the ttl of the key

func Update

func Update(key string, value interface{}) error

Update sets key to value

Types

This section is empty.

Jump to

Keyboard shortcuts

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