kv

package
v0.0.0-...-1d8daf6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Get

func Get() *Client

Get will return redis connection

func Init

func Init(ctx context.Context) (*Client, error)

Init will initialize the key value store

func InitMock

func InitMock(ctx context.Context) (*Client, error)

func (*Client) Conn

func (c *Client) Conn() *redis.Conn

Conn will return redis connection

func (*Client) Delete

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

Delete will remove a key

func (*Client) GetString

func (c *Client) GetString(key string) (string, error)

GetString will read and return a key as string

func (*Client) Set

func (c *Client) Set(key string, val interface{}, alive time.Duration) error

Set will set a key ( string ) to a value ( interface )

func (*Client) With

func (c *Client) With(ctx context.Context) *redis.Client

With returns a Client with context

type InMemory

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

func Memory

func Memory() *InMemory

func (*InMemory) Get

func (i *InMemory) Get(key string) (string, bool)

Get get a key value

func (*InMemory) SetString

func (i *InMemory) SetString(key, value string)

SetString set a key value

Jump to

Keyboard shortcuts

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