redis

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 7 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 {
	Host     string
	Password string
	DB       int
	// contains filtered or unexported fields
}

func GetRedisClientPool

func GetRedisClientPool() (*Client, error)

func NewRedisClientPool

func NewRedisClientPool(host string, options ...Option) (*Client, error)

NewRedisClientPool Setup Initialize the Redis instance

func (*Client) Conn

func (p *Client) Conn() *redis.Client

func (*Client) Delete

func (p *Client) Delete(key string) (int64, error)

Delete delete a kye

func (*Client) Exists

func (p *Client) Exists(key string) bool

Exists check a key

func (*Client) Get

func (p *Client) Get(key string) (string, error)

Get get a key

func (*Client) Set

func (p *Client) Set(key string, data interface{}, time time.Duration) error

Set a key/value

type Option

type Option func(*Client)

func DB

func DB(db int) Option

func Password

func Password(password string) Option

Jump to

Keyboard shortcuts

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