cache

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NoTTL define an entry that lives forever
	NoTTL = time.Duration(0)
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	GetBytes(key string) ([]byte, error)
	SetBytes(key string, value []byte, TTL time.Duration) error

	GetInt64(key string) (int64, error)
	SetInt64(key string, value int64, TTL time.Duration) error

	GetManyInt64(keys []string) (map[string]int64, error)
	SetManyInt64(values map[string]int64, TTL time.Duration) error

	Remove(key string) error
}

Cache represent a KV database

func NewRedisCache

func NewRedisCache(URI string, keyPrefix string) (Cache, error)

NewRedisCache return a new Cache using redis as backend

Jump to

Keyboard shortcuts

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