cache

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: BSD-3-Clause Imports: 4 Imported by: 3

README

cache

redis cache with versioned keys

Documentation

Index

Constants

View Source
const (
	DefaultRedisAddress = "localhost:6379"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(interface{}, interface{}, time.Duration) error
	Get(interface{}, interface{}) error
}

func New

func New(config Config) Cache

func NewWithRedisClient added in v0.0.3

func NewWithRedisClient(version string, client *redis.Client) Cache

func NewWithRedisOptions added in v0.1.0

func NewWithRedisOptions(version string, options *redis.Options) Cache

func NewWithRedisURL added in v0.1.0

func NewWithRedisURL(version string, url string) (Cache, error)

type Config

type Config struct {
	Address  string
	Password string
	Db       int
	Version  string
}

Jump to

Keyboard shortcuts

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