redis

package
v0.0.0-...-c99e017 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheKeys = struct {
	Templates, Hardwares, Workflows, TemplateNames CacheKey
}{
	Templates:     "templates",
	Hardwares:     "hardwares",
	Workflows:     "workflows",
	TemplateNames: "template-names",
}

CacheKeys is a collection of allowed keys

Functions

This section is empty.

Types

type Cache

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

Cache represents the redis cache client

func Instance

func Instance() *Cache

Instance returns an existing client instance; creates new otherwise

func (*Cache) Delete

func (c *Cache) Delete(key CacheKey, fields ...string) error

Delete deletes fields from a given key

func (*Cache) Get

func (c *Cache) Get(key CacheKey, field string) (string, error)

Get retrieves the value for a field in a given key

func (*Cache) GetAll

func (c *Cache) GetAll(key CacheKey) (map[string]string, error)

GetAll retrieves all fields and their respective values in a given key

func (*Cache) Set

func (c *Cache) Set(key CacheKey, field string, value interface{}) error

Set updates the field with the value in a given key

func (*Cache) SetAll

func (c *Cache) SetAll(key CacheKey, fields map[string]interface{}) error

SetAll updates the field with the value in a given key

type CacheKey

type CacheKey string

CacheKey is the string key in redis cache

Jump to

Keyboard shortcuts

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