easyredis

package
v0.0.0-...-a5276b2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRedisInvalid = errors.New("redis is not available")

Functions

This section is empty.

Types

type Option

type Option func(r *Redis)

func WithDB

func WithDB(db int) Option

func WithMasterName

func WithMasterName(masterName string) Option

func WithPassword

func WithPassword(pass string) Option

func WithProxy

func WithProxy(proxyAddr string) Option

type Redis

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

*

  • @description: 写入redis数据
  • @param {*}
  • @return {*}

func NewRedis

func NewRedis(host string, opts ...Option) (r *Redis, err error)

func NewSimpleRedis

func NewSimpleRedis(prefix string) (r *Redis, err error)

*

  • @description: 新建一个redis
  • @param {string} prefix
  • @return {*}

func (*Redis) Close

func (m *Redis) Close() (err error)

func (*Redis) Delete

func (m *Redis) Delete(key string) (err error)

func (*Redis) DeleteField

func (m *Redis) DeleteField(key, field string) (err error)

func (*Redis) Dial

func (m *Redis) Dial(ctx context.Context, network, addr string) (net.Conn, error)

func (*Redis) Get

func (m *Redis) Get(key, field string) (result string, err error)

func (*Redis) HGET

func (m *Redis) HGET(key, field string) (result string, err error)

func (*Redis) HMSet

func (m *Redis) HMSet(key string, list []RedisSetter) (msg string, err error)

func (*Redis) HVALS

func (m *Redis) HVALS(key string) (result []string, err error)

HVALS

func (*Redis) Set

func (m *Redis) Set(key, field, value string) (msg string, err error)

func (*Redis) Setup

func (m *Redis) Setup(prefix string) (err error)

*

  • @description: web客户端的初始化
  • @param {string} prefix key的前缀
  • @return {*}

type RedisSetter

type RedisSetter interface {
	GetID() string
}

Jump to

Keyboard shortcuts

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