redis

package
v0.0.0-...-cc9b1f3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is used to manage redis client

func New

func New(ctx iface.OrdaContext, conf *Config) (*Client, errors.OrdaError)

New creates a redis client

func (*Client) Close

func (its *Client) Close() errors.OrdaError

Close closes redis Client

func (*Client) GetLock

func (its *Client) GetLock(ctx iface.OrdaContext, lockName string) utils.Lock

GetLock gets a lock of redis lock. If redis is not available, a local lock is gotten

type Config

type Config struct {
	Addrs    []string `json:"Addrs"`
	Username string   `json:"Username"`
	Password string   `json:"Password"`
}

Config describes the configuration of redis

Jump to

Keyboard shortcuts

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