Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateSession(request *CreateSessionRequest) (response *CreateSessionResponse, err error)
- func (c *Client) DescribeWorkers(request *DescribeWorkersRequest) (response *DescribeWorkersResponse, err error)
- func (c *Client) StopGame(request *StopGameRequest) (response *StopGameResponse, err error)
- func (c *Client) TrylockWorker(request *TrylockWorkerRequest) (response *TrylockWorkerResponse, err error)
- type CreateSessionRequest
- type CreateSessionResponse
- type DescribeWorkersRequest
- type DescribeWorkersResponse
- type StopGameRequest
- type StopGameResponse
- type TrylockWorkerRequest
- type TrylockWorkerResponse
- type WorkerRegionInfo
Constants ¶
View Source
const APIVersion = "2019-11-18"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) CreateSession ¶
func (c *Client) CreateSession(request *CreateSessionRequest) (response *CreateSessionResponse, err error)
创建会话
func (*Client) DescribeWorkers ¶
func (c *Client) DescribeWorkers(request *DescribeWorkersRequest) (response *DescribeWorkersResponse, err error)
查询空闲机器数量
func (*Client) StopGame ¶
func (c *Client) StopGame(request *StopGameRequest) (response *StopGameResponse, err error)
强制退出游戏
func (*Client) TrylockWorker ¶
func (c *Client) TrylockWorker(request *TrylockWorkerRequest) (response *TrylockWorkerResponse, err error)
尝试锁定机器
type CreateSessionRequest ¶
type CreateSessionRequest struct { *tchttp.BaseRequest // 客户端session信息,从JSSDK请求中获得 ClientSession *string `json:"ClientSession,omitempty" name:"ClientSession"` // 游戏用户ID UserId *string `json:"UserId,omitempty" name:"UserId"` // 游戏ID GameId *string `json:"GameId,omitempty" name:"GameId"` // 游戏区域,ap-guangzhou、ap-shanghai、ap-beijing等 GameRegion *string `json:"GameRegion,omitempty" name:"GameRegion"` // 游戏参数 GameParas *string `json:"GameParas,omitempty" name:"GameParas"` // 分辨率,,可设置为1080p或720p Resolution *string `json:"Resolution,omitempty" name:"Resolution"` // 背景图url,格式为png或jpeg,宽高1920*1080 ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"` // 资源池编号,1表示正式,2表示测试 SetNo *uint64 `json:"SetNo,omitempty" name:"SetNo"` // 单位Mbps,固定码率,后端不动态调整(MaxBitrate和MinBitrate将无效) Bitrate *uint64 `json:"Bitrate,omitempty" name:"Bitrate"` // 单位Mbps,动态调整最大码率 MaxBitrate *uint64 `json:"MaxBitrate,omitempty" name:"MaxBitrate"` // 单位Mbps,动态调整最小码率 MinBitrate *uint64 `json:"MinBitrate,omitempty" name:"MinBitrate"` // 帧率,可设置为30、45或60 Fps *uint64 `json:"Fps,omitempty" name:"Fps"` // 游戏用户IP,用于就近调度,例如125.127.178.228 UserIp *string `json:"UserIp,omitempty" name:"UserIp"` }
func NewCreateSessionRequest ¶
func NewCreateSessionRequest() (request *CreateSessionRequest)
func (*CreateSessionRequest) FromJsonString ¶
func (r *CreateSessionRequest) FromJsonString(s string) error
func (*CreateSessionRequest) ToJsonString ¶
func (r *CreateSessionRequest) ToJsonString() string
type CreateSessionResponse ¶
type CreateSessionResponse struct { *tchttp.BaseResponse Response *struct { // 服务端session信息,返回给JSSDK ServerSession *string `json:"ServerSession,omitempty" name:"ServerSession"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewCreateSessionResponse ¶
func NewCreateSessionResponse() (response *CreateSessionResponse)
func (*CreateSessionResponse) FromJsonString ¶
func (r *CreateSessionResponse) FromJsonString(s string) error
func (*CreateSessionResponse) ToJsonString ¶
func (r *CreateSessionResponse) ToJsonString() string
type DescribeWorkersRequest ¶
type DescribeWorkersRequest struct { *tchttp.BaseRequest // 资源池编号,1表示正式,2表示测试 SetNo *uint64 `json:"SetNo,omitempty" name:"SetNo"` }
func NewDescribeWorkersRequest ¶
func NewDescribeWorkersRequest() (request *DescribeWorkersRequest)
func (*DescribeWorkersRequest) FromJsonString ¶
func (r *DescribeWorkersRequest) FromJsonString(s string) error
func (*DescribeWorkersRequest) ToJsonString ¶
func (r *DescribeWorkersRequest) ToJsonString() string
type DescribeWorkersResponse ¶
type DescribeWorkersResponse struct { *tchttp.BaseResponse Response *struct { // 空闲机器总数量 Idle *uint64 `json:"Idle,omitempty" name:"Idle"` // 区域个数 RegionNum *uint64 `json:"RegionNum,omitempty" name:"RegionNum"` // 各个区域的机器情况 RegionDetail []*WorkerRegionInfo `json:"RegionDetail,omitempty" name:"RegionDetail" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewDescribeWorkersResponse ¶
func NewDescribeWorkersResponse() (response *DescribeWorkersResponse)
func (*DescribeWorkersResponse) FromJsonString ¶
func (r *DescribeWorkersResponse) FromJsonString(s string) error
func (*DescribeWorkersResponse) ToJsonString ¶
func (r *DescribeWorkersResponse) ToJsonString() string
type StopGameRequest ¶
type StopGameRequest struct { *tchttp.BaseRequest // 游戏用户ID UserId *string `json:"UserId,omitempty" name:"UserId"` }
func NewStopGameRequest ¶
func NewStopGameRequest() (request *StopGameRequest)
func (*StopGameRequest) FromJsonString ¶
func (r *StopGameRequest) FromJsonString(s string) error
func (*StopGameRequest) ToJsonString ¶
func (r *StopGameRequest) ToJsonString() string
type StopGameResponse ¶
type StopGameResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewStopGameResponse ¶
func NewStopGameResponse() (response *StopGameResponse)
func (*StopGameResponse) FromJsonString ¶
func (r *StopGameResponse) FromJsonString(s string) error
func (*StopGameResponse) ToJsonString ¶
func (r *StopGameResponse) ToJsonString() string
type TrylockWorkerRequest ¶
type TrylockWorkerRequest struct { *tchttp.BaseRequest // 游戏用户ID UserId *string `json:"UserId,omitempty" name:"UserId"` // 游戏ID GameId *string `json:"GameId,omitempty" name:"GameId"` // 游戏区域,ap-guangzhou、ap-shanghai、ap-beijing等 GameRegion *string `json:"GameRegion,omitempty" name:"GameRegion"` // 资源池编号,1表示共用,2表示测试 SetNo *uint64 `json:"SetNo,omitempty" name:"SetNo"` // 游戏用户IP,用于就近调度,例如125.127.178.228 UserIp *string `json:"UserIp,omitempty" name:"UserIp"` }
func NewTrylockWorkerRequest ¶
func NewTrylockWorkerRequest() (request *TrylockWorkerRequest)
func (*TrylockWorkerRequest) FromJsonString ¶
func (r *TrylockWorkerRequest) FromJsonString(s string) error
func (*TrylockWorkerRequest) ToJsonString ¶
func (r *TrylockWorkerRequest) ToJsonString() string
type TrylockWorkerResponse ¶
type TrylockWorkerResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` }
func NewTrylockWorkerResponse ¶
func NewTrylockWorkerResponse() (response *TrylockWorkerResponse)
func (*TrylockWorkerResponse) FromJsonString ¶
func (r *TrylockWorkerResponse) FromJsonString(s string) error
func (*TrylockWorkerResponse) ToJsonString ¶
func (r *TrylockWorkerResponse) ToJsonString() string
type WorkerRegionInfo ¶
Click to show internal directories.
Click to hide internal directories.