rediskits

package
v0.0.0-...-986a728 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCache

func DeleteCache(rc *redis.Client, key string, retryTimes int) error

DeleteCache delete cache

func GenAutoIncrementalId

func GenAutoIncrementalId(rc *redis.Client, key string, retryTimes int) int64

GenAutoIncrementalId gen auto incremental id

func GetCacheToModel

func GetCacheToModel(rc *redis.Client, key string, model interface{}) (notFound bool)

GetCacheToModel get cache to model

func NewClient

func NewClient(c *RedisConfig) *redis.Client

func SetModelToCache

func SetModelToCache(rc *redis.Client, key string, model interface{}, ttl int) error

SetModelToCache save model to cache

Types

type RedisConfig

type RedisConfig struct {
	Address     string `yaml:"address"`
	Password    string `yaml:"password"`
	Timeout     int    `yaml:"timeout"`
	MaxIdle     int    `yaml:"max_idle"`
	IdleTimeout int    `yaml:"idle_timeout"`
}

Jump to

Keyboard shortcuts

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