database

package
v1.10.11 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheStorageKey = "cache:%s:%s"
	CacheVersionKey = "cache:versions"
)

Variables

This section is empty.

Functions

func NewRedis

func NewRedis(cfg *redis.Options) *redis.Client

Types

type Cache added in v1.2.0

type Cache struct {
	// contains filtered or unexported fields
}

func NewCacheRedis added in v1.2.0

func NewCacheRedis(r redis.Cmdable, version string) (*Cache, error)

func (*Cache) CleanOldestVersion added in v1.2.0

func (c *Cache) CleanOldestVersion() error

func (*Cache) Delete added in v1.2.0

func (c *Cache) Delete(key string) error

func (*Cache) FlushAll added in v1.2.0

func (c *Cache) FlushAll()

func (*Cache) Get added in v1.2.0

func (c *Cache) Get(key string, obj interface{}) error

func (*Cache) Set added in v1.2.0

func (c *Cache) Set(key string, value interface{}, duration time.Duration) error

type CacheInterface added in v1.2.0

type CacheInterface interface {
	Set(string, interface{}, time.Duration) error
	Get(string, interface{}) error
	Delete(string) error
	FlushAll()
	CleanOldestVersion() error
}

Jump to

Keyboard shortcuts

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