redis

package
v0.0.0-...-9648343 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cmd           = radix.Cmd
	FlatCmd       = radix.FlatCmd
	NewEvalScript = radix.NewEvalScript
)
View Source
var ErrNoResult = NoResultError{}
View Source
var Pool *radix.Pool

Pool is a shared-access connection pool

Functions

func Del

func Del(key string) error

func Do

func Do(a radix.Action) error

func Expired

func Expired(key string) (int64, error)

Expired returns the TTL in milliseconds if the key is not expired, or a negative value otherwise.

func Get

func Get(key string) (string, error)

func HGet

func HGet(key, field string) (string, error)

func HGetAll

func HGetAll(key string) (map[string]string, error)

func HSet

func HSet(key, sub, value string) error

func MapFields

func MapFields(values map[string]string) []string

func MustInit

func MustInit(host string)

MustInit initializes the shared pool connection

func Pipeline

func Pipeline(cmds ...radix.CmdAction) error

func PubSub

func PubSub(host string) (radix.PubSubConn, error)

func Publish

func Publish(topic, value string) error

func SAdd

func SAdd(key, value string) (bool, error)

func SCard

func SCard(key string) (int64, error)

func SIsMember

func SIsMember(key, value string) (bool, error)

func SMembers

func SMembers(key string) ([]string, error)

func SRandMember

func SRandMember(key string) (string, error)

func SRem

func SRem(key, value string) (bool, error)

func Set

func Set(key, value string) error

func SetCheckExpired

func SetCheckExpired(key string, td time.Duration) (bool, error)

SetCheckExpired checks if the given key is expired, and if it is returns true and sets the key to a timestamp for the next `td` duration.

func Type

func Type(key string) (string, error)

Types

type CmdAction

type CmdAction = radix.CmdAction

type ErrDiscarded

type ErrDiscarded = resp.ErrDiscarded

type MaybeNil

type MaybeNil = radix.MaybeNil

type NoResultError

type NoResultError struct{}

func (NoResultError) Error

func (NoResultError) Error() string

func (NoResultError) Is

func (NoResultError) Is(target error) bool

func (NoResultError) Unwrap

func (NoResultError) Unwrap() error

type PubSubMessage

type PubSubMessage = radix.PubSubMessage

type Storage

type Storage struct {
}

func (*Storage) Get

func (s *Storage) Get(key string) (string, error)

func (*Storage) Set

func (s *Storage) Set(key, value string) error

type Tuple

type Tuple = radix.Tuple

Jump to

Keyboard shortcuts

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