db

package
v0.0.0-...-02b4230 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

*

*
* @author liangjf
* @create on 2020/6/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/9/9
* @version 1.0

*

*
* @author liangjf
* @create on 2020/6/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/6/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/6/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/6/1
* @version 1.0

*

*
* @author liangjf
* @create on 2020/6/1
* @version 1.0

Index

Constants

View Source
const (
	MsgSeqIDIncrKey = "MsgSeqID"
)

Variables

This section is empty.

Functions

func RegisterDB

func RegisterDB(name string, db IDB)

Types

type IDB

type IDB interface {
	Init()
}

func GetDB

func GetDB(name string) IDB

func NewMysql

func NewMysql() IDB

type RedisPool

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

func NewRedisCluster

func NewRedisCluster(nodes []string) (*RedisPool, error)

func (*RedisPool) Decr

func (p *RedisPool) Decr(key string) (int64, error)

func (*RedisPool) DecrBy

func (p *RedisPool) DecrBy(key string, decrement int64) (int64, error)

func (*RedisPool) Del

func (p *RedisPool) Del(key string) error

func (*RedisPool) Exists

func (p *RedisPool) Exists(key string) (bool, error)

func (*RedisPool) Expire

func (p *RedisPool) Expire(key string, seconds int) error

func (*RedisPool) GenerateMsgSeq

func (p *RedisPool) GenerateMsgSeq(uuid string) uint64

func (*RedisPool) Get

func (p *RedisPool) Get(key string) (interface{}, error)

func (*RedisPool) GetInt

func (p *RedisPool) GetInt(key string) (int, error)

func (*RedisPool) GetString

func (p *RedisPool) GetString(key string) (string, error)

func (*RedisPool) HDel

func (p *RedisPool) HDel(key string, fields string) (int, error)

func (*RedisPool) HExist

func (p *RedisPool) HExist(key, field string) (bool, error)

func (*RedisPool) HGet

func (p *RedisPool) HGet(key, field string) (interface{}, error)

func (*RedisPool) HGetAll

func (p *RedisPool) HGetAll(key string) (map[string]string, error)

func (*RedisPool) HIncrBy

func (p *RedisPool) HIncrBy(key, field string, increment int) (int64, error)

func (*RedisPool) HKeys

func (p *RedisPool) HKeys(key string) ([]string, error)

func (*RedisPool) HLen

func (p *RedisPool) HLen(key string) (int, error)

func (*RedisPool) HMGet

func (p *RedisPool) HMGet(key string, fields ...string) ([]string, error)

func (*RedisPool) HMSet

func (p *RedisPool) HMSet(key string, pairs ...string) error

func (*RedisPool) HSet

func (p *RedisPool) HSet(key, field string, value interface{}) error

func (*RedisPool) HSetNX

func (p *RedisPool) HSetNX(key, field string, value interface{}) (bool, error)

func (*RedisPool) HStrlen

func (p *RedisPool) HStrlen(key, field string) (int, error)

func (*RedisPool) Incr

func (p *RedisPool) Incr(key string) (int64, error)

func (*RedisPool) IncrBy

func (p *RedisPool) IncrBy(key string, increment int64) (int64, error)

func (*RedisPool) MDel

func (p *RedisPool) MDel(keys ...string) (int, error)

func (*RedisPool) MExists

func (p *RedisPool) MExists(keys string) (int, error)

func (*RedisPool) RenameNX

func (p *RedisPool) RenameNX(key, nKey string) error

func (*RedisPool) Set

func (p *RedisPool) Set(key string, value interface{}) error

func (*RedisPool) SetEX

func (p *RedisPool) SetEX(key string, value interface{}, expireSecond int) error

func (*RedisPool) SetNX

func (p *RedisPool) SetNX(key string, value interface{}) error

func (*RedisPool) SetPX

func (p *RedisPool) SetPX(key string, value interface{}, expireMS int) error

func (*RedisPool) Strlen

func (p *RedisPool) Strlen(key string) (int, error)

func (*RedisPool) TTL

func (p *RedisPool) TTL(key string) (int, error)

func (*RedisPool) Type

func (p *RedisPool) Type(key string) (string, error)

Jump to

Keyboard shortcuts

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