redis

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RedisComponent definition
	RedisComponent = "redis"
	// RedisDBType description
	RedisDBType = "In-memory"
)
View Source
const Nil = redis.Nil

Nil represents the error which is returned in case a key is not found.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*redis.Client
}

Client represents a connection with a Redis client.

func New

func New(opt Options) *Client

New returns a new Redis client.

func (*Client) Close

func (c *Client) Close(ctx context.Context, args ...interface{}) error

Close closes the connection to the underlying Redis client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, args ...interface{}) *redis.Cmd

Do creates and processes a custom Cmd on the underlying Redis client.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) *redis.StatusCmd

Ping contacts the redis client, and returns 'PONG' if the client is reachable. It can be used to test whether a connection is still alive, or measure latency.

type Options

type Options redis.Options

Options wraps redis.Options for easier usage.

Jump to

Keyboard shortcuts

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