redis

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeepTTL = redis.KeepTTL

KeepTTL - helper to expose KeepTTL

Functions

This section is empty.

Types

type Client

type Client struct {
	Client *redis.Client
	// contains filtered or unexported fields
}

Client - instance created when initializing client

func New

func New(uri string) (Client, error)

New - constructor to create an instance of the client

func (Client) Del

func (r Client) Del(ctx context.Context, key string) (int64, error)

Del - implementation of redis DEL

func (Client) Get

func (r Client) Get(ctx context.Context, key string) (string, error)

Get - implementation of redis GET

func (Client) Keys

func (r Client) Keys(ctx context.Context, match string) ([]string, error)

Keys - implementation of redis KEYS

func (Client) Lock

func (r Client) Lock(ctx context.Context, key string, ttl time.Duration) (bool, error)

Lock - implementation of redis distributed lock

func (Client) Set

func (r Client) Set(ctx context.Context, key string, value string, ttl time.Duration) (string, error)

Set - implementation of redis SET

func (Client) SetNX

func (r Client) SetNX(ctx context.Context, key string, value string, ttl time.Duration) (bool, error)

SetNX - implementation of redis SET with NX flag

func (Client) Unlock

func (r Client) Unlock(ctx context.Context, key string) (bool, error)

Unlock - implementation of redis distributed unlock

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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