db

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 5 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs []string `mapstructure:"addrs"`
	Pwd   string   `mapstructure:"password"`
	DB    int      `mapstructure:"db"`
}

type Redis

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

func NewRedis

func NewRedis(c Config) *Redis

func (*Redis) Acquire added in v1.10.0

func (r *Redis) Acquire(key string)

Acquire a destributed lock

func (*Redis) Close added in v1.5.0

func (r *Redis) Close()

func (*Redis) Del

func (r *Redis) Del(k string) error

func (*Redis) Expire

func (r *Redis) Expire(key string, t time.Duration) error

func (*Redis) Get added in v0.2.0

func (r *Redis) Get(k string) string

func (*Redis) HDel

func (r *Redis) HDel(key, field string) error

func (*Redis) HGet

func (r *Redis) HGet(key, field string) string

func (*Redis) HGetAll

func (r *Redis) HGetAll(key string) map[string]string

func (*Redis) HMGet added in v1.10.0

func (r *Redis) HMGet(key string, fields ...string) []interface{}

func (*Redis) HMSet added in v1.10.0

func (r *Redis) HMSet(key string, values ...string) error

func (*Redis) HMSetTTL added in v1.10.0

func (r *Redis) HMSetTTL(t time.Duration, k string, values ...interface{}) error

func (*Redis) HSet

func (r *Redis) HSet(key, field string, value interface{}) error

func (*Redis) HSetTTL

func (r *Redis) HSetTTL(t time.Duration, key, field string, value interface{}) error

func (*Redis) Keys

func (r *Redis) Keys(key string) []string

func (*Redis) Release added in v1.10.0

func (r *Redis) Release(key string)

Release a destributed lock

func (*Redis) Set

func (r *Redis) Set(key string, value interface{}, t time.Duration) error

func (*Redis) Watch added in v0.2.0

func (r *Redis) Watch(ctx context.Context, key string) <-chan interface{}

Watch http://redisdoc.com/topic/notification.html

Jump to

Keyboard shortcuts

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