zredis

package
v0.0.0-...-3c7041c Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(redisPool *redis.Pool, key string) (err error)

func Get

func Get(redisPool *redis.Pool, v interface{}, key string) (got bool, err error)

this is a general rotuine that gets something from redis with a key, and unmarshals it to a struct It uses redisPool variable for this facebook package

func GetRangeToJsonItems

func GetRangeToJsonItems(conn redis.Conn, key string, make func() interface{}) (items []interface{}, err error)

func GetRotatingIndex

func GetRotatingIndex(redisPool *redis.Pool, key string, len int, inc bool, timeToLive time.Duration) (n int, rotated bool)

func Init

func Init(rPool *redis.Pool, path string)

func Put

func Put(redisPool *redis.Pool, key string, timeToLive time.Duration, v interface{}) (err error)

this is a general rotuine to put something in redis with a key, expiry and an interface{} to marshall to json It uses redisPool variable for this facebook package

func ScanKeys

func ScanKeys(regex string, handler func(key string) bool) (err error)

func Setup

func Setup(redisServer string) (*redis.Pool, error)

Setup inits redis with address:port. If empty defaults to "localhost:6379"

Types

This section is empty.

Jump to

Keyboard shortcuts

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