redis

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Nil = redis.Nil

Functions

func Init

func Init(opts ...Opt)

func RDB

func RDB(aliasName ...string) *cli

Types

type Opt

type Opt struct {
	AliasName    string
	Network      string
	Addr         string
	Username     string //>6.0
	Password     string
	DB           int
	PoolSize     int //Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.
	MinIdleConns int
	ReadTimeout  time.Duration                                                            `json:"-"`
	WriteTimeout time.Duration                                                            `json:"-"`
	TLSConfig    *tls.Config                                                              `json:"-"`
	OnConnect    func(ctx context.Context, cn *redis.Conn) error                          `json:"-"`
	Dialer       func(ctx context.Context, network string, addr string) (net.Conn, error) `json:"-"`
}

type Pipeliner

type Pipeliner struct {
	redis.Pipeliner
}

type Tx

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

func (*Tx) Del

func (t *Tx) Del(key ...string) (int64, error)

func (*Tx) Pipelined

func (t *Tx) Pipelined(fn func(pipeliner Pipeliner) error) ([]redis.Cmder, error)

func (*Tx) Set

func (t *Tx) Set(key string, val interface{}, expiration ...time.Duration) (string, error)

func (*Tx) SetEx

func (t *Tx) SetEx(key string, val interface{}, expiration ...time.Duration) (string, error)

func (*Tx) SetNx

func (t *Tx) SetNx(key string, val interface{}, expiration ...time.Duration) (bool, error)

Jump to

Keyboard shortcuts

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