redis

package
v0.5.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	DB *redis.Client
}

Store implements kv.Store for Redis

func NewRedisStore

func NewRedisStore(host string, port int, password string, dbIndex int) (Store, error)

NewRedisStore creates a new connection with Redis

func (Store) Close

func (s Store) Close() error

Close will terminate a connection with Redis

func (Store) Delete

func (s Store) Delete(k string) error

Delete given key

func (Store) Get

func (s Store) Get(k string) (v string, found bool, err error)

Get a value from our key-value store

func (Store) Set

func (s Store) Set(k string, v string, expiration time.Duration) error

Set a value for a given key

Jump to

Keyboard shortcuts

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