LiquidSDK

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ColNameLiquidAdmin string = "LIQUIDAdmin"
View Source
const ColNameLiquidMember string = "LIQUIDMember"
View Source
const ColNameLiquidUser string = "LIQUIDUser"
View Source
const ColNameLiquidUserData string = "LIQUIDUserData"

Variables

This section is empty.

Functions

func GameRpcConnection

func GameRpcConnection(remoteIp string) (LiquidRpc.GameAdapterClient, error)

Types

type CmdAccount

type CmdAccount struct {
	FromType  string      `json:"from_type" default:""`
	FromId    string      `json:"from_id" default:""`
	FromToken string      `json:"from_token" default:""`
	Platform  string      `json:"platform" default:"main"`
	ExtraData interface{} `json:"extra_data" default:""`
}

Login, Verify

type CmdAccountResponse

type CmdAccountResponse struct {
	AutoId     *string `json:"auto_id" bson:"auto_id"`
	InviteCode *string `json:"invite_code" bson:"invite_code"`
}

type CmdAuth

type CmdAuth struct {
	AutoId     *string `json:"auto_id" bson:"auto_id"`
	InviteCode *string `json:"invite_code" bson:"invite_code"`
	Platform   *string `json:"platform" bson:"platform"`
}

Auth

type CmdAuthResponse

type CmdAuthResponse struct {
	LiquidId    *string `json:"liquid_id" bson:"liquid_id"`
	LiquidToken *string `json:"liquid_token" bson:"liquid_token"`
}

type CmdBind

type CmdBind struct {
	AutoId     string `json:"auto_id" bson:"auto_id"`
	InviteCode string `json:"invite_code" bson:"invite_code"`
	FromId     string `json:"from_id" bson:"from_id"`       //(str)third_party id or device id
	FromToken  string `json:"from_token" bson:"from_token"` // (str)third_party token
	FromType   string `json:"from_type" bson:"from_type"`   // (str)third_party name
}

Bind

type CmdCommand

type CmdCommand struct {
	LiquidId    *string     `json:"liquid_id" bson:"liquid_id"`
	LiquidToken *string     `json:"liquid_token" bson:"liquid_token"`
	Platform    *string     `json:"platform" bson:"platform"`
	CmdId       *string     `json:"cmd_id"`
	CmdSn       *string     `json:"cmd_sn"`
	CmdName     *string     `json:"cmd_name"`
	CmdData     interface{} `json:"cmd_data"`
}

Command

type CmdCommandResponse

type CmdCommandResponse struct {
	CmdData interface{} `json:"cmd_data"`
	CmdSn   *string     `json:"cmd_sn"`
}

type CmdRegister

type CmdRegister struct {
	FromType  string      `json:"from_type"`
	Account   string      `json:"account"`
	Password  string      `json:"password"`
	ExtraData interface{} `json:"extra_data" default:""`
}

Register

type CmdSignedBody

type CmdSignedBody struct {
	LiSign string `json:"LiSign"`
	LiData string `json:"LiData"`
}

Middleware

type GameRequest

type GameRequest struct {
	CmdData interface{}
}

func (*GameRequest) Get

func (gameRequest *GameRequest) Get(key string) interface{}

func (*GameRequest) Raw

func (gameRequest *GameRequest) Raw() interface{}

func (*GameRequest) ToStruct

func (gameRequest *GameRequest) ToStruct(target interface{}, tag string) error

type GameSystem

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

func (*GameSystem) Register

func (gameSystem *GameSystem) Register(operator string, f func(string, IGameRequest) interface{})

func (*GameSystem) RegisterDirect

func (gameSystem *GameSystem) RegisterDirect(operator string, f func(string, IGameRequest) interface{})

func (*GameSystem) RegisterHttp

func (gameSystem *GameSystem) RegisterHttp(operator string, f func(IGameRequest) interface{})

func (*GameSystem) RunCommand

func (gameSystem *GameSystem) RunCommand(data *CmdCommand) interface{}

func (*GameSystem) RunDirectCommand

func (gameSystem *GameSystem) RunDirectCommand(data *CmdCommand) interface{}

func (*GameSystem) RunHttpCommand

func (gameSystem *GameSystem) RunHttpCommand(data *CmdCommand) interface{}

func (*GameSystem) RunRpcCommand

func (gameSystem *GameSystem) RunRpcCommand(data *LiquidRpc.ReqCmd) interface{}

type IGameRequest

type IGameRequest interface {
	ToStruct(interface{}, string) error
	Raw() interface{}
	Get(key string) interface{}
}

type IGameSystem

type IGameSystem interface {
	RunCommand(*CmdCommand) interface{}
	RunDirectCommand(*CmdCommand) interface{}
	RunHttpCommand(*CmdCommand) interface{}
	RunRpcCommand(cmd *LiquidRpc.ReqCmd) interface{}
}

type ILiquidServer

type ILiquidServer interface {
}

type IMemberSystem

type IMemberSystem interface {
	Register(
		fromType,
		account,
		password,
		platform string,
		extraArgs interface{}) (status int, error string)
	Validate(
		fromId,
		fromToken,
		platform string,
		extraArgs interface{}) (valid bool, msg string, overrideFromId string)
}

type LiquidServer

type LiquidServer struct {
	CodeName        string
	LiquidKey       string
	LiquidKeyUpdate time.Time
	TokenExpireTime int
	// contains filtered or unexported fields
}

func GetServer

func GetServer() *LiquidServer

func (*LiquidServer) ConnectCacheDbService

func (server *LiquidServer) ConnectCacheDbService(config *Settings.CacheDbConf)

func (*LiquidServer) ConnectDocDbService

func (server *LiquidServer) ConnectDocDbService(config *Settings.DocDbConf)

func (*LiquidServer) ConnectMsgQueueService

func (server *LiquidServer) ConnectMsgQueueService(config *Settings.AMQPConf)

func (*LiquidServer) ConnectRDbService

func (server *LiquidServer) ConnectRDbService(config *Settings.RDBConf)

func (*LiquidServer) EnsureLiquidAdminIndexes

func (server *LiquidServer) EnsureLiquidAdminIndexes()

func (*LiquidServer) EnsureLiquidMemberIndexes

func (server *LiquidServer) EnsureLiquidMemberIndexes()

func (*LiquidServer) EnsureLiquidUserIndexes

func (server *LiquidServer) EnsureLiquidUserIndexes()

func (*LiquidServer) GenerateKey

func (server *LiquidServer) GenerateKey()

func (*LiquidServer) GetCacheDb

func (server *LiquidServer) GetCacheDb() *Database.CacheDB

func (*LiquidServer) GetDocColl

func (server *LiquidServer) GetDocColl(collection string) *mongo.Collection

func (*LiquidServer) GetDocCollWithDb

func (server *LiquidServer) GetDocCollWithDb(dbName, collection string) *mongo.Collection

func (*LiquidServer) GetDocDb

func (server *LiquidServer) GetDocDb() *Database.DocDB

func (*LiquidServer) GetGameFeature

func (server *LiquidServer) GetGameFeature(GameName string) IGameSystem

func (*LiquidServer) GetGameRpcConnection

func (server *LiquidServer) GetGameRpcConnection() LiquidRpc.GameAdapterClient

func (*LiquidServer) GetKey

func (server *LiquidServer) GetKey() string

func (*LiquidServer) GetKeyStatic

func (server *LiquidServer) GetKeyStatic() string

func (*LiquidServer) GetLiquidAdminCol

func (server *LiquidServer) GetLiquidAdminCol() *mongo.Collection

func (*LiquidServer) GetLiquidMemberCol

func (server *LiquidServer) GetLiquidMemberCol() *mongo.Collection

func (*LiquidServer) GetLiquidUserCol

func (server *LiquidServer) GetLiquidUserCol() *mongo.Collection

func (*LiquidServer) GetLiquidUserDataCol

func (server *LiquidServer) GetLiquidUserDataCol() *mongo.Collection

func (*LiquidServer) GetMemberSystem

func (server *LiquidServer) GetMemberSystem(memberType string) IMemberSystem

func (*LiquidServer) GetMsgQueueV0

func (server *LiquidServer) GetMsgQueueV0() *MsgQueue.AMQPv0

func (*LiquidServer) GetMsgQueueV1

func (server *LiquidServer) GetMsgQueueV1() *MsgQueue.AMQPv1

func (*LiquidServer) GetRdb

func (server *LiquidServer) GetRdb() *Database.RDB

func (*LiquidServer) GetRpcTrafficEnabled

func (server *LiquidServer) GetRpcTrafficEnabled() bool

func (*LiquidServer) InitCodenameKey

func (server *LiquidServer) InitCodenameKey()

func (*LiquidServer) InitRpcTraffic

func (server *LiquidServer) InitRpcTraffic(conf *Settings.AppConf)

func (*LiquidServer) InitializeSystemDocIndexes

func (server *LiquidServer) InitializeSystemDocIndexes()

func (*LiquidServer) RegisterGameFeature

func (server *LiquidServer) RegisterGameFeature(GameName string, GameInstance IGameSystem) bool

func (*LiquidServer) RegisterMember

func (server *LiquidServer) RegisterMember(memberType string, MemberInstance IMemberSystem) bool

func (*LiquidServer) SetCodeName

func (server *LiquidServer) SetCodeName(codename string)

type RpcFeature

type RpcFeature struct{}

func (*RpcFeature) Command

func (e *RpcFeature) Command(ctx context.Context, req *LiquidRpc.ReqCmd) (resp *LiquidRpc.RespCmd, err error)

func (*RpcFeature) Login

func (e *RpcFeature) Login(ctx context.Context, req *LiquidRpc.ReqLogin) (resp *LiquidRpc.RespLogin, err error)

Jump to

Keyboard shortcuts

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