RedisConn

package
Version: v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDle_Invalie = iota
	IDle_one
	IDle_two
	IDle_three
	IDle_four
	IDle_five
)

pool Idl

View Source
const (
	IDleTimeOut_invalid = iota
	//second
	IDleTimeOut_five_sec = 5 * time.Second
	IDleTimeOut_ten_sec  = 10 * time.Second
	//minute
	IDleTimeOut_one_min   = 60 * time.Second
	IDleTimeOut_two_min   = 120 * time.Second
	IDleTimeOut_three_min = 180 * time.Second
	IDleTimeOut_four_min  = 240 * time.Second
)

idl timeout value

View Source
const (
	// common used MilliSecond
	MSec_one         = time.Millisecond
	MSec_ten         = 10 * time.Millisecond
	MSec_one_Hundred = 100 * time.Millisecond

	// common used Second
	Sec_five    = 5 * time.Second
	Sec_ten     = 10 * time.Second
	Sec_fifteen = 15 * time.Second
	Sec_twenty  = 20 * time.Second
	Sec_thirty  = 30 * time.Second
	Sec_fourty  = 40 * time.Second
	Sec_fifty   = 50 * time.Second
	Sec_sixty   = 60 * time.Second
)
View Source
const (
	ERedHasKeyTransferMultiNum = 1000
)

role key transfer redis hash key multi

View Source
const (
	ERedScript_Update string = "update"
)

script name define...

Variables

This section is empty.

Functions

func MakeRedisModel

func MakeRedisModel(Identify, MainModel, SubModel string) string

func ParseRedisKey

func ParseRedisKey(redkey string) (Identify, MainModel, SubModel string)

func RoleKey2Haskey

func RoleKey2Haskey(key string) (hashk int)

key is 21 length string min key: "111111111111111111111" string to int32 val:1029 max key: "fffffffffffffffffffff" string to int32 val:2142 sub number : 1675 key transfer interge %1000 with 1-1000

func Subscriber

func Subscriber(pool *redis.Pool, subcontent interface{})

Types

type REDIS_INT32

type REDIS_INT32 int32
const (
	REDIS_SET_DEADLINE REDIS_INT32 = 600 //s

)

type TAokoRedis

type TAokoRedis struct {
	ConnAddr string
	DBIndex  int32
	Passwd   string
	RedPool  *redis.Pool
	// contains filtered or unexported fields
}

func NewRedisConn

func NewRedisConn(ConnAddr string, DBIndex int32, Passwd string, upcb public.UpdateDBCacheCallBack) *TAokoRedis

func (*TAokoRedis) Exit

func (this *TAokoRedis) Exit()

func (*TAokoRedis) Insert

func (this *TAokoRedis) Insert(Identify string, Input public.IDBCache) (err error)

Redis Oper func: Insert SaveType: EDBOper_Insert purpose: in order to Insert data type EDBOperType to Redis Cache.

func (*TAokoRedis) NewDial

func (this *TAokoRedis) NewDial() error

func (*TAokoRedis) Query

func (this *TAokoRedis) Query(Identify string, Output public.IDBCache) (ret error)

Redis Oper func: Query purpose: in order to Get data from Redis Cache.

func (*TAokoRedis) Save

func (this *TAokoRedis) Save(rolekey, RedisKey string, data interface{}, SaveType ado.EDBOperType) (ret error)

func (*TAokoRedis) SaveEx

func (this *TAokoRedis) SaveEx(rolekey, RedisKey string, data interface{}, SaveType ado.EDBOperType) (ret error, cacheOper bool)

func (*TAokoRedis) Update

func (this *TAokoRedis) Update(Identify string, Input public.IDBCache, SaveType ado.EDBOperType) (err error, cacheOper bool)

Redis Oper func: Update SaveType: EDBOper_Update purpose: in order to Update data type EDBOperType to Redis Cache.

type TRedisCtrl

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

func LazyInit

func LazyInit() (redctl *TRedisCtrl)

func (*TRedisCtrl) AddRedisConn

func (this *TRedisCtrl) AddRedisConn(c *TAokoRedis)

func (*TRedisCtrl) ChangeNextChannl

func (this *TRedisCtrl) ChangeNextChannl() (c *TAokoRedis)

type TRedisScript

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

Jump to

Keyboard shortcuts

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