redis

package
v0.0.0-...-7389028 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScriptTypeToScript

func ScriptTypeToScript(scriptType ScriptType) (string, ie.ServerError)

ScriptTypeToScript will get the script for a ScriptType.

Types

type RedigoClient

type RedigoClient struct {
	Pool *redigo.Pool
}

RedigoClient is a Redis client implementation using Redigo.

func NewRedigoClient

func NewRedigoClient(url string, maxConnections int) (*RedigoClient, error)

NewRedigoClient will create a new RedigoClient.

func (*RedigoClient) Del

func (client *RedigoClient) Del(ctx context.Context, keys ...string) error

Del will run the Redis DEL command.

func (*RedigoClient) Eval

func (client *RedigoClient) Eval(ctx context.Context, script string, keys []string, args []interface{}) (interface{}, error)

Eval will run the Redis EVAL command.

func (*RedigoClient) Get

func (client *RedigoClient) Get(ctx context.Context, key string) (interface{}, error)

Get will run the Redis GET command.

func (*RedigoClient) MGet

func (client *RedigoClient) MGet(ctx context.Context, keys []string) ([]interface{}, error)

MGet will run the Redis MGET command.

func (*RedigoClient) MSet

func (client *RedigoClient) MSet(ctx context.Context, keys []string, values []interface{}) error

MSet will run the Redis MSET command.

func (*RedigoClient) Set

func (client *RedigoClient) Set(ctx context.Context, key string, value interface{}) error

Set will run the Redis SET command.

type ScriptType

type ScriptType int

ScriptType is an enum.

const (
	// ScriptTypeSet will set a namespaced resource.
	ScriptTypeSet ScriptType = iota

	// ScriptTypeGet will get a namespaced resource.
	ScriptTypeGet

	// ScriptTypeGetAll will get all of a namespaced resource.
	ScriptTypeGetAll

	// ScriptTypeRemove will remove a namespaced resource.
	ScriptTypeRemove

	// ScriptTypeRemoveAll will remove all of a namespaced resource.
	ScriptTypeRemoveAll

	// ScriptTypePeek is the script type for the peek script.
	ScriptTypePeek

	// ScriptTypeCheck is the script type for the check script.
	ScriptTypeCheck

	// ScriptTypeFinish is the script type for the finish script.
	ScriptTypeFinish
)

Jump to

Keyboard shortcuts

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