Documentation ¶
Index ¶
- func CommandToHttpAdapter(f func(string, CommandRequest) interface{}) func(*gin.Context, CommandRequest)
- type CmdAccount
- type CmdAccountResponse
- type CmdAuth
- type CmdAuthResponse
- type CmdBind
- type CmdCommand
- type CmdCommandResponse
- type CmdErrorResponse
- type CmdRegister
- type CmdSignedBody
- type CommandRequest
- type CommandSDK
- func (system *CommandSDK) Register(name string, f func(string, CommandRequest) interface{}, ...)
- func (system *CommandSDK) RegisterDirect(name string, f func(string, CommandRequest) interface{}, ...)
- func (system *CommandSDK) RegisterHttp(name string, f func(*gin.Context, CommandRequest))
- func (system *CommandSDK) RegisterHttpDirect(name string, f func(*gin.Context, CommandRequest))
- func (system *CommandSDK) RunCommand(data *CmdCommand) interface{}
- func (system *CommandSDK) RunDirectCommand(data *CmdCommand) interface{}
- func (system *CommandSDK) RunHttpCommand(c *gin.Context, data *CmdCommand)
- func (system *CommandSDK) RunHttpDirectCommand(c *gin.Context, data *CmdCommand)
- type CommandSystem
- type LiquidRequest
- func (request *LiquidRequest) Get(key string) interface{}
- func (request *LiquidRequest) GetCmdId() string
- func (request *LiquidRequest) GetCmdName() string
- func (request *LiquidRequest) GetCmdSn() string
- func (request *LiquidRequest) GetLiquidId() string
- func (request *LiquidRequest) GetPlatform() string
- func (request *LiquidRequest) Raw() interface{}
- func (request *LiquidRequest) ToStruct(target interface{}, tag string) error
- type LiquidServer
- func (server *LiquidServer) GenerateKey()
- func (server *LiquidServer) GetFeature(Name string) CommandSystem
- func (server *LiquidServer) GetKey() string
- func (server *LiquidServer) GetKeyStatic() string
- func (server *LiquidServer) GetMemberSystem(memberType string) MemberSystem
- func (server *LiquidServer) InitCodenameKey()
- func (server *LiquidServer) RegisterFeature(Name string, Instance CommandSystem) bool
- func (server *LiquidServer) RegisterMember(memberType string, MemberInstance MemberSystem) bool
- func (server *LiquidServer) SetCodeName(codename string)
- func (server *LiquidServer) SetTokenExpireTime(seconds int)
- type MemberSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandToHttpAdapter ¶ added in v1.4.0
func CommandToHttpAdapter(f func(string, CommandRequest) interface{}) func(*gin.Context, CommandRequest)
Types ¶
type CmdAccount ¶
type CmdAccountResponse ¶
type CmdAuthResponse ¶
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 }
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"` }
type CmdCommandResponse ¶
type CmdCommandResponse struct { CmdData interface{} `json:"cmd_data"` CmdSn *string `json:"cmd_sn"` }
type CmdErrorResponse ¶ added in v1.4.0
type CmdErrorResponse struct { Code int `json:"code"` Error string `json:"error"` Type string `json:"type,omitempty"` }
func ResponseError ¶ added in v1.4.1
func ResponseError(code int, error string) CmdErrorResponse
type CmdRegister ¶
type CmdSignedBody ¶
type CommandRequest ¶
type CommandSDK ¶
type CommandSDK struct {
// contains filtered or unexported fields
}
func (*CommandSDK) Register ¶
func (system *CommandSDK) Register(name string, f func(string, CommandRequest) interface{}, opts ...*options.CommandOptions)
func (*CommandSDK) RegisterDirect ¶
func (system *CommandSDK) RegisterDirect(name string, f func(string, CommandRequest) interface{}, opts ...*options.CommandOptions)
func (*CommandSDK) RegisterHttp ¶
func (system *CommandSDK) RegisterHttp(name string, f func(*gin.Context, CommandRequest))
func (*CommandSDK) RegisterHttpDirect ¶
func (system *CommandSDK) RegisterHttpDirect(name string, f func(*gin.Context, CommandRequest))
func (*CommandSDK) RunCommand ¶
func (system *CommandSDK) RunCommand(data *CmdCommand) interface{}
func (*CommandSDK) RunDirectCommand ¶
func (system *CommandSDK) RunDirectCommand(data *CmdCommand) interface{}
func (*CommandSDK) RunHttpCommand ¶
func (system *CommandSDK) RunHttpCommand(c *gin.Context, data *CmdCommand)
func (*CommandSDK) RunHttpDirectCommand ¶
func (system *CommandSDK) RunHttpDirectCommand(c *gin.Context, data *CmdCommand)
type CommandSystem ¶
type CommandSystem interface { RunCommand(*CmdCommand) interface{} RunDirectCommand(*CmdCommand) interface{} RunHttpDirectCommand(*gin.Context, *CmdCommand) RunHttpCommand(*gin.Context, *CmdCommand) }
type LiquidRequest ¶
type LiquidRequest struct { LiquidId *string Platform *string CmdId *string CmdSn *string CmdName *string CmdData interface{} }
func (*LiquidRequest) Get ¶
func (request *LiquidRequest) Get(key string) interface{}
func (*LiquidRequest) GetCmdId ¶
func (request *LiquidRequest) GetCmdId() string
func (*LiquidRequest) GetCmdName ¶
func (request *LiquidRequest) GetCmdName() string
func (*LiquidRequest) GetCmdSn ¶
func (request *LiquidRequest) GetCmdSn() string
func (*LiquidRequest) GetLiquidId ¶
func (request *LiquidRequest) GetLiquidId() string
func (*LiquidRequest) GetPlatform ¶
func (request *LiquidRequest) GetPlatform() string
func (*LiquidRequest) Raw ¶
func (request *LiquidRequest) Raw() interface{}
func (*LiquidRequest) ToStruct ¶
func (request *LiquidRequest) ToStruct(target interface{}, tag string) error
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) GenerateKey ¶
func (server *LiquidServer) GenerateKey()
func (*LiquidServer) GetFeature ¶
func (server *LiquidServer) GetFeature(Name string) CommandSystem
func (*LiquidServer) GetKey ¶
func (server *LiquidServer) GetKey() string
func (*LiquidServer) GetKeyStatic ¶
func (server *LiquidServer) GetKeyStatic() string
func (*LiquidServer) GetMemberSystem ¶
func (server *LiquidServer) GetMemberSystem(memberType string) MemberSystem
func (*LiquidServer) InitCodenameKey ¶
func (server *LiquidServer) InitCodenameKey()
func (*LiquidServer) RegisterFeature ¶
func (server *LiquidServer) RegisterFeature(Name string, Instance CommandSystem) bool
func (*LiquidServer) RegisterMember ¶
func (server *LiquidServer) RegisterMember(memberType string, MemberInstance MemberSystem) bool
func (*LiquidServer) SetCodeName ¶
func (server *LiquidServer) SetCodeName(codename string)
func (*LiquidServer) SetTokenExpireTime ¶
func (server *LiquidServer) SetTokenExpireTime(seconds int)
Click to show internal directories.
Click to hide internal directories.