redis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package redis implements redis adapters of the cachebox.Storage interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redigo

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

Redigo implements the cachebox.Storage interface by wrapping a redigo redis Pool.

func NewRedigo

func NewRedigo(pool RedigoPool) *Redigo

NewRedigo returns a new Redigo instance.

func (*Redigo) Delete

func (r *Redigo) Delete(ctx context.Context, keys ...string) error

Delete performs a single or many delete calls.

func (*Redigo) MGet

func (r *Redigo) MGet(ctx context.Context, keys ...string) ([][]byte, error)

MGet performs a get or a multi get call.

func (*Redigo) Set

func (r *Redigo) Set(ctx context.Context, items ...cachebox.Item) error

Set performs a single or many set calls.

type RedigoPool

type RedigoPool interface {
	GetContext(ctx context.Context) (redis.Conn, error)
}

RedigoPool is the interface that enables instrumentation by callers, wrapping a *redis.Pool on their side.

Jump to

Keyboard shortcuts

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