redis

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: MIT Imports: 5 Imported by: 0

README

redis

Simple library for working with redis as KV

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis struct {
	Host         string `yaml:"host"`         // Host
	Port         *int32 `yaml:"port"`         // Port default 6379
	Password     string `yaml:"password"`     // Password
	DB           int    `yaml:"db"`           // DB
	ValueTimeout *int   `yaml:"valueTimeout"` //ValueTimeout minutes default 60 minutes
	// contains filtered or unexported fields
}

Redis - redis settings

func (*Redis) Close

func (rd *Redis) Close() error

Close - close connection to redis

func (*Redis) GetValue

func (rd *Redis) GetValue(key string) (result interface{}, err error)

GetValue - get value from redis

func (*Redis) Init

func (rd *Redis) Init() error

Init - initialize properties

func (*Redis) IsConnected added in v1.0.5

func (rd *Redis) IsConnected() bool

* IsConnection - status connection

func (*Redis) Open

func (rd *Redis) Open() error

Open - open connection to redis

func (*Redis) Remove added in v1.0.3

func (rd *Redis) Remove(key string) error

Remove - remove value from redis

func (*Redis) SetValue

func (rd *Redis) SetValue(key string, value interface{}) error

SetValue - store value into redis

func (*Redis) SetValueWithTimeout added in v1.0.3

func (rd *Redis) SetValueWithTimeout(key string, value interface{}, timeout time.Duration) error

SetValueWithTimeout - store value into redis with timeout

Jump to

Keyboard shortcuts

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