redis

package module
v0.0.0-...-1fbe94e Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyHost is an error that indicates no redis host is set.
	ErrEmptyHost = errors.New("empty redis host")
	// ErrEmptyType is an error that indicates no redis type is set.
	ErrEmptyType = errors.New("empty redis type")
	// ErrEmptyKey is an error that indicates no redis key is set.
	ErrEmptyKey = errors.New("empty redis key")
)

Functions

This section is empty.

Types

type ClosableNode

type ClosableNode interface {
	RedisNode
	Close()
}

ClosableNode interface represents a closable redis node.

func CreateBlockingNode

func CreateBlockingNode(r *Redis) (ClosableNode, error)

CreateBlockingNode returns a ClosableNode.

type RedisConf

type RedisConf struct {
	Host     string
	Type     string `json:",default=node,options=node|cluster"`
	Pass     string `json:",optional"`
	Tls      bool   `json:",optional"`
	NonBlock bool   `json:",default=true"`
	// PingTimeout is the timeout for ping redis.
	PingTimeout time.Duration `json:",default=1s"`
	DB          int           `json:",default=0"`
}

A RedisConf is a redis config.

func (RedisConf) NewRedis

func (rc RedisConf) NewRedis() *Redis

NewRedis returns a Redis. Deprecated: use MustNewRedis or NewRedis instead.

func (RedisConf) Validate

func (rc RedisConf) Validate() error

Validate validates the RedisConf.

type RedisKeyConf

type RedisKeyConf struct {
	RedisConf
	Key string
}

A RedisKeyConf is a redis config with key.

func (RedisKeyConf) Validate

func (rkc RedisKeyConf) Validate() error

Validate validates the RedisKeyConf.

Jump to

Keyboard shortcuts

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