redis

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const POOL_SIZE = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	InstanceID  int    `json:"InstanceId"`
	IP          string `json:"Ip"`
	Port        int    `json:"Port"`
	Password    string `json:"Password"`
	IsCluster   bool   `json:"IsCluster"`
	DbIndex     int    `json:"DbIndex"`
	Description string `json:"Description"`
}

redis config struct

type RedisMgr

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

* RedisMgr * @Description:

func NewRedisMgr

func NewRedisMgr() *RedisMgr

* * @Description: new redis mgr * @return: *RedisMgr * @Author: Iori * @Date: 2022-02-26 11:42:47 *

func (*RedisMgr) AddInstance

func (m *RedisMgr) AddInstance(instID uint32, ip string, port int, password string, dbIndex int, isCluster bool) error

* * @Description: AddInstance * @receiver: m * @param: instID * @param: ip * @param: port * @param: password * @param: dbIndex * @param: isCluster * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:37 *

func (*RedisMgr) DelKey

func (m *RedisMgr) DelKey(instID uint32, key string) error

* * @Description: DelKey * @receiver: m * @param: instID * @param: key * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:06 *

func (*RedisMgr) DoCmd

func (m *RedisMgr) DoCmd(instID uint32, result interface{}, cmd string, args ...string) error

* * @Description: DoCmd * @receiver: m * @param: instID * @param: result * @param: cmd * @param: args * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:22 *

func (*RedisMgr) DoFlatCmd

func (m *RedisMgr) DoFlatCmd(instID uint32, result interface{}, cmd, key string, args ...interface{}) error

* * @Description: DoFlatCmd * @receiver: m * @param: instID * @param: result * @param: cmd * @param: key * @param: args * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:27 *

func (*RedisMgr) GetBytes

func (m *RedisMgr) GetBytes(instID uint32, key string) ([]byte, error)

* * @Description: GetBytes * @receiver: m * @param: instID * @param: key * @return: []byte * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:14 *

func (*RedisMgr) GetClient

func (m *RedisMgr) GetClient(instID uint32) radix.Client

* * @Description: GetClient * @receiver: m * @param: instID * @return: radix.Client * @Author: Iori * @Date: 2022-02-26 11:42:31 *

func (*RedisMgr) IncrByKey

func (m *RedisMgr) IncrByKey(instID uint32, key string, value int64) (int64, error)

* * @Description: INCRBY(自增自定义数) * @receiver: m * @param: instID * @param: key * @return: int64 * @return: error * @Author: Iori * @Date: 2022-02-26 11:41:35 *

func (*RedisMgr) IncrKey

func (m *RedisMgr) IncrKey(instID uint32, key string) (int64, error)

* * @Description: INCR(自增) * @receiver: m * @param: instID * @param: key * @return: int64 * @return: error * @Author: Iori * @Date: 2022-02-26 11:41:35 *

func (*RedisMgr) InitAndRun

func (self *RedisMgr) InitAndRun(dbIns []Config) error

* * @Description: InitAndRun * @receiver: self * @param: dbIns * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:42 *

func (*RedisMgr) MGetBytes

func (m *RedisMgr) MGetBytes(instID uint32, keys []string) ([]string, error)

* * @Description: MGetBytes * @receiver: m * @param: instID * @param: keys * @return: []string * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:10 *

func (*RedisMgr) SetBytes

func (m *RedisMgr) SetBytes(instID uint32, key string, value []byte) error

* * @Description: SetBytes * @receiver: m * @param: instID * @param: key * @param: value * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:18 *

func (*RedisMgr) SetBytesEx

func (m *RedisMgr) SetBytesEx(instID uint32, key string, value []byte, second int64) error

func (*RedisMgr) ZsetRange

func (m *RedisMgr) ZsetRange(instID uint32, setName string, beginIdx, endIdx int32) ([]string, error)

* * @Description: ZsetRange * @receiver: m * @param: instID * @param: setName * @param: beginIdx * @param: endIdx * @return: []string * @return: error * @Author: Iori * @Date: 2022-02-26 11:41:55 *

func (*RedisMgr) ZsetSet

func (m *RedisMgr) ZsetSet(instID uint32, setName string, key string, score int32) error

* * @Description: ZsetSet * @receiver: m * @param: instID * @param: setName * @param: key * @param: score * @return: error * @Author: Iori * @Date: 2022-02-26 11:42:01 *

Jump to

Keyboard shortcuts

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