redis

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: GPL-2.0, GPL-2.0-or-later Imports: 11 Imported by: 7

Documentation

Overview

Package redis provides an interface to query and modify a local server.

Index

Constants

This section is empty.

Variables

View Source
var DefaultHash string

Functions

func Assign

func Assign(key, sockname, name string) error

Assign an RPC handler for the given key.

func Complete

func Complete(args ...string) (c []string)

Complete redis Key and Subkey. This skips over leading '-' prefaced flags.

func Connect

func Connect() (redis.Conn, error)

Connect to the redis file socket.

func Fprintln

func Fprintln(w io.Writer, s string)

func Get

func Get(key string) (s string, err error)

func Hdel

func Hdel(key, field string, fields ...string) (i int, err error)

func Hexists

func Hexists(key, field string) (i int, err error)

func Hget

func Hget(key, field string) (s string, err error)

func Hkeys

func Hkeys(key string) (keys []string, err error)

func Hset

func Hset(key, field string, v interface{}) (i int, err error)

func Hwait

func Hwait(key, field, value string, dur time.Duration) error

Wait for the given (key, field) to have value or anything if value is "".

func IsReady

func IsReady() error

func Keys

func Keys(pattern string) (keys []string, err error)

func Lrange

func Lrange(key string, start, stop int) (keys []string, err error)

func NewRedisRegAtSock

func NewRedisRegAtSock() (*rpc.Client, error)

func NewRedisdAtSock

func NewRedisdAtSock() (net.Conn, error)

func Publish

func Publish(name string, depth ...int) (chan<- string, error)

Publish messages to the named redis channel. Messages sent through the returned channel are forwarded to the redis server until the channel is closed.

pub, err := redis.Publish(NAME[, DEPTH])
if err {
	panic()
}
defer close(pub)
...
pub.Print("hello world")

The default message channel depth is 16.

func Quotes

func Quotes(s string) string

func Set

func Set(key string, value interface{}) (s string, err error)

func Split

func Split(key string) []string

Split a structured redis key.

"eth0" -> ["eth0"]
"eth0.mtu" -> ["eth0", "mtu"]
"eth0.addr.[10.0.2.15]" -> ["eth0", "addr", "10.0.2.15"]
"eth0.addr.[10.0.2.15].broadcast" ->
	["eth0", "addr", "10.0.2.15", "broadcast"]

func Subscribe

func Subscribe(channel string) (psc redis.PubSubConn, err error)

func Unassign

func Unassign(key string) error

Unassign an RPC handler for the given key.

Types

This section is empty.

Directories

Path Synopsis
rpc
Package rpc provides remote calls to a redis server.
Package rpc provides remote calls to a redis server.
args
Package args provides types for the redis RPC arguments.
Package args provides types for the redis RPC arguments.
reg
Package reg provides an RPC to register redis handlers.
Package reg provides an RPC to register redis handlers.
reply
Package reply provides types and methods for the redis RPC replies.
Package reply provides types and methods for the redis RPC replies.

Jump to

Keyboard shortcuts

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