redis

package
v0.0.0-...-6f440d7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	URL      string        `yaml:"url"`
	Db       int           `yaml:"db"`
	Password string        `yaml:"password"`
	RedisTTL time.Duration `yaml:"ttl"`
}

Connector provides access to redis

func (*Connector) DeleteRegex

func (r *Connector) DeleteRegex(regex string) error

DeleteRegex - deletes all keys/values with regex match

func (*Connector) GetList

func (r *Connector) GetList(regex string) ([]string, error)

GetList returns a list of keys based on regex

func (*Connector) GetStringValue

func (r *Connector) GetStringValue(key string) (string, error)

GetStringValue - get string value of key

func (*Connector) GetValue

func (r *Connector) GetValue(key string) ([]byte, error)

GetValue returns the value from redis of given key if exists

func (*Connector) WriteValue

func (r *Connector) WriteValue(key string, value string, TTL ...time.Duration) (err error)

WriteValue Write @value to @key in redis

Jump to

Keyboard shortcuts

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