Src

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublishID       = "Publish"
	PublishTemplate = `` /* 155-byte string literal not displayed */

)

Publish - 寫入一個數字

View Source
const (
	DecCountDownID       = "DecCountDown"
	DecCountDownTemplate = `` /* 2068-byte string literal not displayed */

)

DecCountDown - 計數器減少

View Source
const (
	DecValueID       = "DecValue"
	DecValueTemplate = `` /* 1083-byte string literal not displayed */

)

DecValue - 減少數值

View Source
const (
	DelCountDownID       = "DelCountDown"
	DelCountDownTemplate = `` /* 1471-byte string literal not displayed */

)

DelCountDown - 刪除計數器

View Source
const (
	DelHashAllID       = "DelHashAll"
	DelHashAllTemplate = `` /* 652-byte string literal not displayed */

)

DelHashAll - 減少數值

View Source
const (
	DelHashID       = "DelHash"
	DelHashTemplate = `` /* 728-byte string literal not displayed */

)

DelHash - 減少數值

View Source
const (
	DelListAllID       = "DelListAll"
	DelListAllTemplate = `` /* 652-byte string literal not displayed */

)

DelListAll - 減少數值

View Source
const (
	DelListID       = "DelList"
	DelListTemplate = `` /* 819-byte string literal not displayed */

)

DelList - 減少數值

View Source
const (
	DelSetAllID       = "DelSetAll"
	DelSetAllTemplate = `` /* 653-byte string literal not displayed */

)

DelSetAll - 減少數值

View Source
const (
	DelSetID       = "DelSet"
	DelSetTemplate = `` /* 729-byte string literal not displayed */

)

DelSet - 減少數值

View Source
const (
	DelStringID       = "DelString"
	DelStringTemplate = `` /* 1055-byte string literal not displayed */

)

DelString - 寫入一個字串

View Source
const (
	DelValueID       = "DelValue"
	DelValueTemplate = `` /* 1284-byte string literal not displayed */

)

DelValue - 刪除一個數值

View Source
const (
	DelZsetAllID       = "DelZsetAll"
	DelZsetAllTemplate = `` /* 652-byte string literal not displayed */

)

DelZsetAll - 寫入一個數字

View Source
const (
	DelZsetID       = "DelZset"
	DelZsetTemplate = `` /* 729-byte string literal not displayed */

)

DelZset - 寫入一個數字

View Source
const (
	ExpireKEYID       = "ExpireKEY"
	ExpireKEYTemplate = `` /* 803-byte string literal not displayed */

)

ExpireKEY - 寫入一個字串

View Source
const (
	GetCountDownID       = "GetCountDown"
	GetCountDownTemplate = `` /* 1415-byte string literal not displayed */

)

GetCountDown - 計數器減少

View Source
const (
	GetHashAllID       = "GetHashAll"
	GetHashAllTemplate = `` /* 766-byte string literal not displayed */

)

GetHashAll - 減少數值

View Source
const (
	GetHashID       = "GetHash"
	GetHashTemplate = `` /* 837-byte string literal not displayed */

)

GetHash - 減少數值

View Source
const (
	GetListAllID       = "GetListAll"
	GetListAllTemplate = `` /* 781-byte string literal not displayed */

)

GetListAll - 減少數值

View Source
const (
	GetListLengthID       = "GetListLength"
	GetListLengthTemplate = `` /* 790-byte string literal not displayed */

)

GetListLength - 減少數值

View Source
const (
	GetListPopID       = "GetListPop"
	GetListPopTemplate = `` /* 867-byte string literal not displayed */

)

GetListPop - 減少數值

View Source
const (
	GetListID       = "GetList"
	GetListTemplate = `` /* 866-byte string literal not displayed */

)

GetList - 減少數值

View Source
const (
	GetSetAllID       = "GetSetAll"
	GetSetAllTemplate = `` /* 702-byte string literal not displayed */

)

GetSetAll - 減少數值

View Source
const (
	GetSetRandomID       = "GetSetRandom"
	GetSetRandomTemplate = `` /* 790-byte string literal not displayed */

)

GetSetRandom - 減少數值

View Source
const (
	GetSetID       = "GetSet"
	GetSetTemplate = `` /* 818-byte string literal not displayed */

)

GetSet - 減少數值

View Source
const (
	GetStringID       = "GetString"
	GetStringTemplate = `` /* 1133-byte string literal not displayed */

)

GetString - 寫入一個字串

View Source
const (
	GetUUIDID       = "GetUUID"
	GetUUIDTemplate = `` /* 646-byte string literal not displayed */

)

GetUUID - 寫入一個字串

View Source
const (
	GetValueAllID       = "GetValueAll"
	GetValueAllTemplate = `` /* 767-byte string literal not displayed */

)

GetValueAll - 取得數值陣列

View Source
const (
	GetValueID       = "GetValue"
	GetValueTemplate = `` /* 1226-byte string literal not displayed */

)

GetValue - 取得數字

View Source
const (
	GetZsetAllID       = "GetZsetAll"
	GetZsetAllTemplate = `` /* 696-byte string literal not displayed */

)

GetZsetAll - 寫入一個字串

View Source
const (
	GetZsetID       = "GetZset"
	GetZsetTemplate = `` /* 876-byte string literal not displayed */

)

GetZset - 寫入一個字串

View Source
const (
	IncCountDownID       = "IncCountDown"
	IncCountDownTemplate = `` /* 2069-byte string literal not displayed */

)

IncCountDown - 計數器+

View Source
const (
	IncValueID       = "IncValue"
	IncValueTemplate = `` /* 1546-byte string literal not displayed */

)

IncValue - 增加數字

View Source
const (
	NewHashID       = "NewHash"
	NewHashTemplate = `` /* 886-byte string literal not displayed */

)

NewHash - 減少數值

View Source
const (
	NewListID       = "NewList"
	NewListTemplate = `` /* 995-byte string literal not displayed */

)

NewList - 減少數值

View Source
const (
	NewSetID       = "NewSet"
	NewSetTemplate = `` /* 851-byte string literal not displayed */

)

NewSet - 減少數值

View Source
const (
	NewStringID       = "NewString"
	NewStringTemplate = `` /* 1456-byte string literal not displayed */

)

NewString - 寫入一個字串

View Source
const (
	NewZsetID       = "NewZset"
	NewZsetTemplate = `` /* 1006-byte string literal not displayed */

)

NewZset - 減少數值

View Source
const (
	RoomJoinID       = "RoomJoin"
	RoomJoinTemplate = `` /* 6267-byte string literal not displayed */

)

RoomJoin - 減少數值

View Source
const (
	RoomLeftID       = "RoomLeft"
	RoomLeftTemplate = `` /* 3584-byte string literal not displayed */

)

RoomLeft - 減少數值

View Source
const (
	RoomListID       = "RoomList"
	RoomListTemplate = `` /* 1405-byte string literal not displayed */

)

RoomList - 減少數值

View Source
const (
	RoomPlayerID       = "RoomPlayer"
	RoomPlayerTemplate = `` /* 1195-byte string literal not displayed */

)

RoomPlayer - 減少數值

View Source
const (
	TakeValueID       = "TakeValue"
	TakeValueTemplate = `` /* 1140-byte string literal not displayed */

)

TakeValue - 取得數字

View Source
const (
	TTLKeyID       = "TTLKey"
	TTLKeyTemplate = `` /* 693-byte string literal not displayed */

)

TTLKey - 寫入一個字串

View Source
const (
	UpdateCountDownID       = "UpdateCountDown"
	UpdateCountDownTemplate = `` /* 1815-byte string literal not displayed */

)

UpdateCountDown - 計數器減少

View Source
const (
	UpdateHashID       = "UpdateHash"
	UpdateHashTemplate = `` /* 889-byte string literal not displayed */

)

UpdateHash - 減少數值

View Source
const (
	UpdateListID       = "UpdateList"
	UpdateListTemplate = `` /* 1241-byte string literal not displayed */

)

UpdateList - 減少數值

View Source
const (
	UpdateSetID       = "UpdateSet"
	UpdateSetTemplate = `` /* 960-byte string literal not displayed */

)

UpdateSet - 減少數值

View Source
const (
	UpdateStringID       = "UpdateString"
	UpdateStringTemplate = `` /* 1293-byte string literal not displayed */

)

UpdateString - 寫入一個字串

View Source
const (
	UpdateTTLStringID       = "UpdateTTLString"
	UpdateTTLStringTemplate = `` /* 861-byte string literal not displayed */

)

UpdateString - 寫入一個字串

View Source
const (
	UpdateValueID       = "UpdateValue"
	UpdateValueTemplate = `` /* 1473-byte string literal not displayed */

)

UpdateValue - 寫入一個數字

View Source
const (
	UpdateZsetID       = "UpdateZset"
	UpdateZsetTemplate = `` /* 1012-byte string literal not displayed */

)

UpdateZset - 減少數值

Variables

View Source
var LuaScripts = map[string]string{

	RoomJoinID:   RoomJoinTemplate,
	RoomLeftID:   RoomLeftTemplate,
	RoomListID:   RoomListTemplate,
	RoomPlayerID: RoomPlayerTemplate,

	IncValueID:    IncValueTemplate,
	GetValueID:    GetValueTemplate,
	GetValueAllID: GetValueAllTemplate,
	DecValueID:    DecValueTemplate,
	DelValueID:    DelValueTemplate,
	TakeValueID:   TakeValueTemplate,

	IncCountDownID: IncCountDownTemplate,
	GetCountDownID: GetCountDownTemplate,
	DecCountDownID: DecCountDownTemplate,
	DelCountDownID: DelCountDownTemplate,

	NewStringID:       NewStringTemplate,
	UpdateStringID:    UpdateStringTemplate,
	GetStringID:       GetStringTemplate,
	DelStringID:       DelStringTemplate,
	UpdateTTLStringID: UpdateTTLStringTemplate,

	NewHashID:    NewHashTemplate,
	GetHashID:    GetHashTemplate,
	GetHashAllID: GetHashAllTemplate,
	UpdateHashID: UpdateHashTemplate,
	DelHashID:    DelHashTemplate,
	DelHashAllID: DelHashAllTemplate,

	NewListID:       NewListTemplate,
	GetListID:       GetListTemplate,
	GetListPopID:    GetListPopTemplate,
	GetListAllID:    GetListAllTemplate,
	GetListLengthID: GetListLengthTemplate,
	UpdateListID:    UpdateListTemplate,
	DelListID:       DelListTemplate,
	DelListAllID:    DelListAllTemplate,

	NewSetID:       NewSetTemplate,
	GetSetID:       GetSetTemplate,
	GetSetRandomID: GetSetRandomTemplate,
	GetSetAllID:    GetSetAllTemplate,
	UpdateSetID:    UpdateSetTemplate,
	DelSetID:       DelSetTemplate,
	DelSetAllID:    DelSetAllTemplate,

	NewZsetID:    NewZsetTemplate,
	GetZsetID:    GetZsetTemplate,
	GetZsetAllID: GetZsetAllTemplate,
	UpdateZsetID: UpdateZsetTemplate,
	DelZsetID:    DelZsetTemplate,
	DelZsetAllID: DelZsetAllTemplate,

	GetUUIDID:   GetUUIDTemplate,
	TTLKeyID:    TTLKeyTemplate,
	ExpireKEYID: ExpireKEYTemplate,
}
View Source
var Pubsub sync.Map

Functions

This section is empty.

Types

type MyScriptor

type MyScriptor struct {
	Scriptor *goredis.Scriptor
}

func (*MyScriptor) CloseSubscribe

func (s *MyScriptor) CloseSubscribe(Channel string)

func (*MyScriptor) DecCountDown

func (s *MyScriptor) DecCountDown(keys, args []string) (int64, int64)

DecCountDown function - keys, args[] string - return int64 , int64

func (*MyScriptor) DecValue

func (s *MyScriptor) DecValue(keys, args []string) (int64, error)

DecValue function - keys, args[] string - return int64 , error

func (*MyScriptor) DelCountDown

func (s *MyScriptor) DelCountDown(keys, args []string) (int64, int64)

DelCountDown function - keys, args[] string - return int64 , int64

func (*MyScriptor) DelHash

func (s *MyScriptor) DelHash(keys, args []string)

DelHash function - keys, args[] string

func (*MyScriptor) DelHashAll

func (s *MyScriptor) DelHashAll(keys, args []string)

DelHashAll function - keys, args[] string

func (*MyScriptor) DelList

func (s *MyScriptor) DelList(keys, args []string)

DelList function - keys, args[] string

func (*MyScriptor) DelListAll

func (s *MyScriptor) DelListAll(keys, args []string)

DelListAll function - keys, args[] string

func (*MyScriptor) DelSet

func (s *MyScriptor) DelSet(keys, args []string)

DelSet function - keys, args[] string

func (*MyScriptor) DelSetAll

func (s *MyScriptor) DelSetAll(keys, args []string)

DelSetAll function - keys, args[] string

func (*MyScriptor) DelString

func (s *MyScriptor) DelString(keys, args []string)

DelString function - keys, args[] string

func (*MyScriptor) DelValue

func (s *MyScriptor) DelValue(keys, args []string)

DelValue function - keys, args[] string

func (*MyScriptor) DelZset

func (s *MyScriptor) DelZset(keys, args []string)

DelZset function - keys, args[] string

func (*MyScriptor) DelZsetAll

func (s *MyScriptor) DelZsetAll(keys, args []string)

DelZsetAll function - keys, args[] string

func (*MyScriptor) ExpireKEY

func (s *MyScriptor) ExpireKEY(keys, args []string) (string, error)

ExpireKEY function - keys, args[] string - return string , error

func (*MyScriptor) GetCountDown

func (s *MyScriptor) GetCountDown(keys, args []string) (int64, int64)

GetCountDown function - keys, args[] string - return int64 , int64

func (*MyScriptor) GetHash

func (s *MyScriptor) GetHash(keys, args []string) (string, error)

GetHash function - keys, args[] string - return string , error

func (*MyScriptor) GetHashAll

func (s *MyScriptor) GetHashAll(keys, args []string) (*[]RedisResult, error)

GetHashAll function - keys, args[] string - return *[]HashResult , error

func (*MyScriptor) GetList

func (s *MyScriptor) GetList(keys, args []string) (string, error)

GetList function - keys, args[] string - return string , error

func (*MyScriptor) GetListAll

func (s *MyScriptor) GetListAll(keys, args []string) (*[]RedisResult, error)

GetListAll function - keys, args[] string - return *[]RedisResult] , error

func (*MyScriptor) GetListLength

func (s *MyScriptor) GetListLength(keys, args []string) (int64, error)

GetListLength function - keys, args[] string - return int64 , error

func (*MyScriptor) GetListPop

func (s *MyScriptor) GetListPop(keys, args []string) (*RedisResult, error)

GetListPop function - keys, args[] string - return RedisResult , error model : L lpush list前 // R rpush list後

func (*MyScriptor) GetSet

func (s *MyScriptor) GetSet(keys, args []string) (string, error)

GetSet function - keys, args[] string - return string , error

func (*MyScriptor) GetSetAll

func (s *MyScriptor) GetSetAll(keys, args []string) (*[]RedisResult, error)

GetSetAll function - keys, args[] string - return *[]HashResult , error

func (*MyScriptor) GetSetRandom

func (s *MyScriptor) GetSetRandom(keys, args []string) (*[]RedisResult, error)

GetSetRandom function - keys, args[subkey,request datacount] string - return *[]HashResult , error

func (*MyScriptor) GetString

func (s *MyScriptor) GetString(keys, args []string) (string, error)

GetString function - keys, args[] string - return string , error

func (*MyScriptor) GetUUID

func (s *MyScriptor) GetUUID(stringCount int64) (string, error)

GetUUID function - StringCount int64 - return string , error

func (*MyScriptor) GetValue

func (s *MyScriptor) GetValue(keys, args []string) (int64, error)

GetValue function - keys, args[] string - return int64 , error

func (*MyScriptor) GetValueAll added in v0.0.6

func (s *MyScriptor) GetValueAll(keys, args []string) (*[]RedisResult, error)

GetValueAll function - keys, args[] string - return *[]HashResult , error

func (*MyScriptor) GetZset

func (s *MyScriptor) GetZset(keys, args []string) (*RedisResult, error)

GetZset function - keys, args[] string - return int64 , error

func (*MyScriptor) GetZsetAll

func (s *MyScriptor) GetZsetAll(keys, args []string) (*[]RedisResult, error)

GetZsetAll function - keys, args[] string - return int64 , error

func (*MyScriptor) IncCountDown

func (s *MyScriptor) IncCountDown(keys, args []string) (int64, int64)

IncCountDown function - keys, args[] string - return int64 , int64

func (*MyScriptor) IncValue

func (s *MyScriptor) IncValue(keys, args []string) (int64, error)

IncValue function - keys, args[] string - return int64 , error

func (*MyScriptor) NewHash

func (s *MyScriptor) NewHash(keys, args []string) (string, error)

NewHash function - keys, args []string - return string , error

func (*MyScriptor) NewList

func (s *MyScriptor) NewList(keys, args []string) (string, error)

NewList function - keys, args[] string - return string , error

func (*MyScriptor) NewSet

func (s *MyScriptor) NewSet(keys, args []string) (string, error)

NewSet function - keys, args[] string - return string , error

func (*MyScriptor) NewString

func (s *MyScriptor) NewString(keys, args []string) (string, error)

NewString function - keys, args[] string - return string , error

func (*MyScriptor) NewZset

func (s *MyScriptor) NewZset(keys, args []string) (*RedisResult, error)

NewZset function - keys, args[] string - return string , error

func (*MyScriptor) Publish

func (s *MyScriptor) Publish(Channel string, data interface{})

Publish function - Channel string, data interface{} -

func (*MyScriptor) RoomJoin

func (s *MyScriptor) RoomJoin(
	keys []string,
	platformID string,
	gameID string,
	countryCode string,
	playerID string,
	maxPlayerCount int,
	seatsCount int,
	date string,
	isBot bool,
	roomId string,
) (string, error)

RoomJoin function - args[] string - return string , error

func (*MyScriptor) RoomLeft

func (s *MyScriptor) RoomLeft(
	keys []string,
	platformID string,
	gameID string,
	countryCode string,
	playerID string,

) (interface{}, error)

RoomLeft function - keys, args[] string - return string , error

func (*MyScriptor) RoomList

func (s *MyScriptor) RoomList(
	keys []string,
) (interface{}, error)

RoomList function - keys, args[] string - return interface{} , error

func (*MyScriptor) RoomPlayer

func (s *MyScriptor) RoomPlayer(
	keys []string,
	platformID string,
	gameID string,
	countryCode string,
) (interface{}, error)

RoomPlayer function - keys, args[] string - return interface{} , error

func (*MyScriptor) SubscribeString

func (s *MyScriptor) SubscribeString(Channel string, callback func(string))

SubscribeString -

func (*MyScriptor) TTLKey

func (s *MyScriptor) TTLKey(keys, args []string) (string, error)

TTLKey function - keys, args[] string - return string , error

func (*MyScriptor) TakeValue added in v0.0.6

func (s *MyScriptor) TakeValue(keys, args []string) (int64, error)

TakeValue function - keys, args[] string - return int64 , error

func (*MyScriptor) UpdateCountDown

func (s *MyScriptor) UpdateCountDown(keys, args []string) (int64, int64)

UpdateCountDown function - keys, args[] string - return int64 , int64

func (*MyScriptor) UpdateHash

func (s *MyScriptor) UpdateHash(keys, args []string) (string, error)

UpdateHash function - keys, args[] string - return string , error

func (*MyScriptor) UpdateList

func (s *MyScriptor) UpdateList(keys, args []string) (string, error)

UpdateList function - keys, args[] string - return string , error

func (*MyScriptor) UpdateSet

func (s *MyScriptor) UpdateSet(keys, args []string) (string, error)

UpdateSet function - keys, args[] string - return string , error

func (*MyScriptor) UpdateString

func (s *MyScriptor) UpdateString(keys, args []string) (string, error)

UpdateString function - keys, args[] string - return string , eror

func (*MyScriptor) UpdateTTLString

func (s *MyScriptor) UpdateTTLString(keys, args []string) (string, error)

UpdateTTLString function - keys, args[] string - return string , eror

func (*MyScriptor) UpdateValue

func (s *MyScriptor) UpdateValue(keys, args []string) (int64, error)

UpdateValue function - keys, args[] string - return int64 , error

func (*MyScriptor) UpdateZset

func (s *MyScriptor) UpdateZset(keys, args []string) (*RedisResult, error)

NewZset function - keys, args[] string - return string , error

type RedisResult

type RedisResult struct {
	Value      string
	Value2     string
	CountDown  int64
	EndTime    int64
	ValueInt64 int64
	Key        string
}

RedisResult -

type RoomJoinError

type RoomJoinError struct {
	Error struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

type RoomJoinResult

type RoomJoinResult struct {
	RoomID  string       `json:"roomId"`
	SeatID  string       `json:"seatId"`
	Players []RoomPlayer `json:"players"`
}

type RoomPlayer

type RoomPlayer struct {
	SeatID   string `json:"SeatID"`
	UserID   string `json:"UserID"`
	Credit   string `json:"Credit"`
	BetIndex string `json:"BetIndex"`
}

type SubscribeResult

type SubscribeResult struct {
	Channel string
	Payload string
}

SubscribeResult -

Jump to

Keyboard shortcuts

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