core

package
v1.2.213 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0, JSON Imports: 14 Imported by: 1

Documentation

Overview

*

  • Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
  • Reserved. *
  • Licensed under the Apache License, Version 2.0 (the "License").
  • You may not use this file except in compliance with the License.
  • A copy of the License is located at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • or in the "license" file accompanying this file. This file is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  • express or implied. See the License for the specific language governing
  • permissions and limitations under the License.

*

  • Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
  • Reserved. *
  • Licensed under the Apache License, Version 2.0 (the "License").
  • You may not use this file except in compliance with the License.
  • A copy of the License is located at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • or in the "license" file accompanying this file. This file is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  • express or implied. See the License for the specific language governing
  • permissions and limitations under the License.

*

  • Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
  • Reserved. *
  • Licensed under the Apache License, Version 2.0 (the "License").
  • You may not use this file except in compliance with the License.
  • A copy of the License is located at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • or in the "license" file accompanying this file. This file is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  • express or implied. See the License for the specific language governing
  • permissions and limitations under the License.

Index

Constants

View Source
const (
	Get    = HttpMethod("GET")
	Post   = HttpMethod("POST")
	Put    = HttpMethod("PUT")
	Delete = HttpMethod("DELETE")
)

Variables

View Source
var (
	EndpointHost   = "https://{service}.{region}.gen2.gs2io.com"
	WsEndpointHost = "wss://gateway-ws.{region}.gen2.gs2io.com"
)

Functions

func Cast2Strings

func Cast2Strings(value []interface{}) [][]*string

func Cast2StringsFromDict

func Cast2StringsFromDict(value [][]*string) []interface{}

func CastArray

func CastArray(value interface{}) []interface{}

func CastBool

func CastBool(value interface{}) *bool

func CastBools

func CastBools(value []interface{}) []*bool

func CastBoolsFromDict

func CastBoolsFromDict(value []*bool) []interface{}

func CastFloat32

func CastFloat32(value interface{}) *float32

func CastFloat32s

func CastFloat32s(value []interface{}) []*float32

func CastFloat32sFromDict

func CastFloat32sFromDict(value []*float32) []interface{}

func CastFloat64

func CastFloat64(value interface{}) *float64

func CastFloat64s

func CastFloat64s(value []interface{}) []*float64

func CastFloat64sFromDict

func CastFloat64sFromDict(value []*float64) []interface{}

func CastInt32

func CastInt32(value interface{}) *int32

func CastInt32s

func CastInt32s(value []interface{}) []*int32

func CastInt32sFromDict

func CastInt32sFromDict(value []*int32) []interface{}

func CastInt64

func CastInt64(value interface{}) *int64

func CastInt64s

func CastInt64s(value []interface{}) []*int64

func CastInt64sFromDict

func CastInt64sFromDict(value []*int64) []interface{}

func CastMap

func CastMap(value interface{}) map[string]interface{}

func CastString

func CastString(value interface{}) *string

func CastStrings

func CastStrings(value []interface{}) []*string

func CastStringsFromDict

func CastStringsFromDict(value []*string) []interface{}

func CastUserId

func CastUserId(value interface{}) *string

func CastUserIds

func CastUserIds(value []interface{}) []*string

func CastUserIdsFromDict

func CastUserIdsFromDict(value []*string) []interface{}

func MarshalJson

func MarshalJson(v interface{}) ([]byte, error)

func ToString

func ToString(data interface{}) string

Types

type AccessToken

type AccessToken = string

type AccessTokenType

type AccessTokenType string

type AsyncResult

type AsyncResult struct {
	Payload string
	Err     error
}

type BadGatewayException

type BadGatewayException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (BadGatewayException) ClientError

func (p BadGatewayException) ClientError() *ClientError

func (BadGatewayException) Error

func (p BadGatewayException) Error() string

func (BadGatewayException) RequestErrors

func (p BadGatewayException) RequestErrors() []RequestError

func (BadGatewayException) SetClientError

func (p BadGatewayException) SetClientError(err ClientError) Gs2Exception

type BadRequestException

type BadRequestException struct {
	Errors []RequestError `json:"errors"`
	// contains filtered or unexported fields
}

func (BadRequestException) ClientError

func (p BadRequestException) ClientError() *ClientError

func (BadRequestException) Error

func (p BadRequestException) Error() string

func (BadRequestException) RequestErrors

func (p BadRequestException) RequestErrors() []RequestError

func (BadRequestException) SetClientError

func (p BadRequestException) SetClientError(err ClientError) Gs2Exception

type BasicGs2Credential

type BasicGs2Credential struct {
	ClientId     ClientId
	ClientSecret ClientSecret
}

func (BasicGs2Credential) GetClientId

func (p BasicGs2Credential) GetClientId() *ClientId

func (BasicGs2Credential) GetClientSecret

func (p BasicGs2Credential) GetClientSecret() *ClientSecret

type Bodies

type Bodies map[string]interface{}

type ClientError

type ClientError interface {
	Type() string
	Code() string
}

type ClientId

type ClientId string

type ClientSecret

type ClientSecret string

type ConflictException

type ConflictException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (ConflictException) ClientError

func (p ConflictException) ClientError() *ClientError

func (ConflictException) Error

func (p ConflictException) Error() string

func (ConflictException) RequestErrors

func (p ConflictException) RequestErrors() []RequestError

func (ConflictException) SetClientError

func (p ConflictException) SetClientError(err ClientError) Gs2Exception

type ConnectAsyncResult

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

type Connection

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

type ConnectionBroken

type ConnectionBroken struct {
}

func (ConnectionBroken) Error

func (p ConnectionBroken) Error() string

type ContextStack

type ContextStack = string

type ErrorResult

type ErrorResult struct {
	Message string `json:"message"`
}

type ExpiresIn

type ExpiresIn int64

type Gs2Exception

type Gs2Exception interface {
	RequestErrors() []RequestError
	SetClientError(err ClientError) Gs2Exception
	ClientError() *ClientError
	Error() string
}

type Gs2Model

type Gs2Model interface {
	// contains filtered or unexported methods
}

type Gs2RestSession

type Gs2RestSession struct {
	Credential IGs2Credential
	Region     Region
	// contains filtered or unexported fields
}

func (*Gs2RestSession) Connect

func (p *Gs2RestSession) Connect() error

func (*Gs2RestSession) ConnectAsync

func (p *Gs2RestSession) ConnectAsync(
	callback chan<- ConnectAsyncResult,
)

func (Gs2RestSession) CreateAuthorizationHeader

func (p Gs2RestSession) CreateAuthorizationHeader() map[string]string

func (*Gs2RestSession) Disconnect

func (p *Gs2RestSession) Disconnect()

func (Gs2RestSession) EndpointHost

func (p Gs2RestSession) EndpointHost(service string) Url

func (*Gs2RestSession) Send

func (p *Gs2RestSession) Send(
	job *NetworkJob,
	isBlocking bool,
) error

type Gs2Result

type Gs2Result interface {
	// contains filtered or unexported methods
}

type Gs2WebSocketSession

type Gs2WebSocketSession struct {
	Credential IGs2Credential
	Region     Region

	Jobs []*WebSocketNetworkJob
	// contains filtered or unexported fields
}

func (*Gs2WebSocketSession) AddNotificationHandler

func (p *Gs2WebSocketSession) AddNotificationHandler(handler func(message Notification))

func (*Gs2WebSocketSession) Connect

func (p *Gs2WebSocketSession) Connect() error

func (*Gs2WebSocketSession) ConnectAsync

func (p *Gs2WebSocketSession) ConnectAsync(
	callback chan<- ConnectAsyncResult,
)

func (Gs2WebSocketSession) CreateAuthorizationHeader

func (p Gs2WebSocketSession) CreateAuthorizationHeader() map[string]string

func (*Gs2WebSocketSession) Disconnect

func (p *Gs2WebSocketSession) Disconnect()

func (Gs2WebSocketSession) EndpointHost

func (p Gs2WebSocketSession) EndpointHost(service string) Url

func (*Gs2WebSocketSession) Send

func (p *Gs2WebSocketSession) Send(
	job *WebSocketNetworkJob,
	isBlocking bool,
) error

type HttpHeaders

type HttpHeaders map[string]string

type HttpMethod

type HttpMethod string

type IGs2Credential

type IGs2Credential interface {
	GetClientId() *ClientId
	GetClientSecret() *ClientSecret
}

type ISession

type ISession interface {
	// contains filtered or unexported methods
}

type InternalServerErrorException

type InternalServerErrorException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (InternalServerErrorException) ClientError

func (p InternalServerErrorException) ClientError() *ClientError

func (InternalServerErrorException) Error

func (InternalServerErrorException) RequestErrors

func (p InternalServerErrorException) RequestErrors() []RequestError

func (InternalServerErrorException) SetClientError

type LoginResult

type LoginResult struct {
	Gs2Result
	AccessToken ProjectToken    `json:"access_token"`
	TokenType   AccessTokenType `json:"token_type"`
	ExpiresIn   ExpiresIn       `json:"expires_in"`
}

func (LoginResult) ToDict

func (p LoginResult) ToDict() map[string]interface{}

type NetworkJob

type NetworkJob struct {
	Url          Url
	Method       HttpMethod
	Headers      HttpHeaders
	QueryStrings QueryStrings
	Bodies       Bodies
	Callback     chan<- AsyncResult
}

type NoInternetConnectionException

type NoInternetConnectionException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (NoInternetConnectionException) ClientError

func (p NoInternetConnectionException) ClientError() *ClientError

func (NoInternetConnectionException) Error

func (NoInternetConnectionException) RequestErrors

func (p NoInternetConnectionException) RequestErrors() []RequestError

func (NoInternetConnectionException) SetClientError

type NotFoundException

type NotFoundException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (NotFoundException) ClientError

func (p NotFoundException) ClientError() *ClientError

func (NotFoundException) Error

func (p NotFoundException) Error() string

func (NotFoundException) RequestErrors

func (p NotFoundException) RequestErrors() []RequestError

func (NotFoundException) SetClientError

func (p NotFoundException) SetClientError(err ClientError) Gs2Exception

type Notification

type Notification struct {
	Issuer  string `json:"issuer"`
	Subject string `json:"subject"`
	Payload string `json:"payload"`
}

type OwnerId

type OwnerId string

type ProjectToken

type ProjectToken string

type ProjectTokenGs2Credential

type ProjectTokenGs2Credential struct {
	IGs2Credential
	OwnerId      OwnerId
	ProjectToken ProjectToken
}

func (ProjectTokenGs2Credential) GetClientId

func (p ProjectTokenGs2Credential) GetClientId() *ClientId

func (ProjectTokenGs2Credential) GetClientSecret

func (p ProjectTokenGs2Credential) GetClientSecret() *ClientSecret

type QueryStrings

type QueryStrings map[string]string

type QuotaExceedException

type QuotaExceedException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (QuotaExceedException) ClientError

func (p QuotaExceedException) ClientError() *ClientError

func (QuotaExceedException) Error

func (p QuotaExceedException) Error() string

func (QuotaExceedException) RequestErrors

func (p QuotaExceedException) RequestErrors() []RequestError

func (QuotaExceedException) SetClientError

func (p QuotaExceedException) SetClientError(err ClientError) Gs2Exception

type Region

type Region string
const (
	ApNortheast1 Region = "ap-northeast-1"
	UsEast1      Region = "us-east-1"
	EuWest1      Region = "eu-west-1"
	ApSoutheast1 Region = "ap-southeast-1"
)

type RequestError

type RequestError struct {
	Component *string `json:"component"`
	Message   *string `json:"message"`
	Code      *string `json:"code"`
}

type RequestId

type RequestId = string

type RequestTimeoutException

type RequestTimeoutException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (RequestTimeoutException) ClientError

func (p RequestTimeoutException) ClientError() *ClientError

func (RequestTimeoutException) Error

func (p RequestTimeoutException) Error() string

func (RequestTimeoutException) RequestErrors

func (p RequestTimeoutException) RequestErrors() []RequestError

func (RequestTimeoutException) SetClientError

func (p RequestTimeoutException) SetClientError(err ClientError) Gs2Exception

type ServiceUnavailableException

type ServiceUnavailableException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (ServiceUnavailableException) ClientError

func (p ServiceUnavailableException) ClientError() *ClientError

func (ServiceUnavailableException) Error

func (ServiceUnavailableException) RequestErrors

func (p ServiceUnavailableException) RequestErrors() []RequestError

func (ServiceUnavailableException) SetClientError

type UnauthorizedException

type UnauthorizedException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (UnauthorizedException) ClientError

func (p UnauthorizedException) ClientError() *ClientError

func (UnauthorizedException) Error

func (p UnauthorizedException) Error() string

func (UnauthorizedException) RequestErrors

func (p UnauthorizedException) RequestErrors() []RequestError

func (UnauthorizedException) SetClientError

func (p UnauthorizedException) SetClientError(err ClientError) Gs2Exception

type UnknownException

type UnknownException struct {
	Errors []RequestError
	// contains filtered or unexported fields
}

func (UnknownException) ClientError

func (p UnknownException) ClientError() *ClientError

func (UnknownException) Error

func (p UnknownException) Error() string

func (UnknownException) RequestErrors

func (p UnknownException) RequestErrors() []RequestError

func (UnknownException) SetClientError

func (p UnknownException) SetClientError(err ClientError) Gs2Exception

type Url

type Url string

func (Url) AppendPath

func (p Url) AppendPath(
	path string,
	stringReplacer *strings.Replacer,
) Url

type WebSocketBodies

type WebSocketBodies map[string]interface{}

type WebSocketMessageContainer

type WebSocketMessageContainer struct {
	RequestId WebSocketRequestId               `json:"requestId"`
	Message   WebSocketMessageContainerMessage `json:"message"`
	Body      map[string]interface{}           `json:"body"`
	Type      WebSocketMessageContainerType    `json:"type"`
	Status    WebSocketMessageContainerStatus  `json:"status"`
}

type WebSocketMessageContainerBody

type WebSocketMessageContainerBody string

type WebSocketMessageContainerMessage

type WebSocketMessageContainerMessage string

type WebSocketMessageContainerStatus

type WebSocketMessageContainerStatus int

type WebSocketMessageContainerType

type WebSocketMessageContainerType string

type WebSocketNetworkJob

type WebSocketNetworkJob struct {
	RequestId WebSocketRequestId
	Bodies    WebSocketBodies
	Callback  chan<- AsyncResult
}

type WebSocketRequestId

type WebSocketRequestId string

type WebsocketConnection

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

Jump to

Keyboard shortcuts

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