Documentation ¶
Index ¶
- Constants
- Variables
- func InstanceIdToStorageKey(id string) (string, error)
- func NewGameLiftFleetManager(ctx context.Context, logger runtime.Logger, db *sql.DB, ...) (runtime.FleetManagerInitializer, error)
- func NewInstanceInfo(gs types.GameSession) *runtime.InstanceInfo
- type DeleteInstanceInfoRequest
- type GameLiftConfig
- type GameLiftFleetManager
- func (fm *GameLiftFleetManager) Create(ctx context.Context, maxPlayers int, userIds []string, ...) error
- func (fm *GameLiftFleetManager) Delete(ctx context.Context, id string) error
- func (fm *GameLiftFleetManager) DeleteInstanceInfo(ctx context.Context, logger runtime.Logger, db *sql.DB, ...) (string, error)
- func (fm *GameLiftFleetManager) Get(ctx context.Context, id string) (instance *runtime.InstanceInfo, err error)
- func (fm *GameLiftFleetManager) Init(nk runtime.NakamaModule, callbackHandler runtime.FmCallbackHandler) error
- func (fm *GameLiftFleetManager) Join(ctx context.Context, id string, userIds []string, metadata map[string]string) (joinInfo *runtime.JoinInfo, err error)
- func (fm *GameLiftFleetManager) List(ctx context.Context, query string, limit int, prevCursor string) (list []*runtime.InstanceInfo, nextCursor string, err error)
- func (fm *GameLiftFleetManager) Update(ctx context.Context, id string, playerCount int, metadata map[string]any) error
- func (fm *GameLiftFleetManager) UpdateInstanceInfo(ctx context.Context, logger runtime.Logger, db *sql.DB, ...) (string, error)
- type SqsMessage
- type SqsMessagePlacementEventBody
- type UpdateInstanceInfoRequest
Constants ¶
View Source
const ( StorageGameLiftIndex = "_gamelift_instances_idx" StorageGameLiftInstancesCollection = "_gamelift_instances" )
View Source
const ( GameSessionDataKey = "GameSessionData" GamePropertiesKey = "GameProperties" GameSessionNameKey = "GameSessionName" )
View Source
const ( RpcIdUpdateInstanceInfo = "update_instance_info" RpcIdDeleteInstanceInfo = "delete_instance_info" )
View Source
const ( GameLiftEventIdPlacementFulfilled = "PlacementFulfilled" GameLiftEventIdPlacementCancelled = "PlacementCancelled" GameLiftEventIdPlacementTimedOut = "PlacementTimedOut" GameLiftEventIdPlacementFailed = "PlacementFailed" )
Variables ¶
View Source
var ( ErrInvalidInput = runtime.NewError("input is invalid", 3) // INVALID_ARGUMENT ErrInternalError = runtime.NewError("internal server error", 13) // INTERNAL )
Functions ¶
func InstanceIdToStorageKey ¶
func NewGameLiftFleetManager ¶
func NewGameLiftFleetManager(ctx context.Context, logger runtime.Logger, db *sql.DB, initializer runtime.Initializer, nk runtime.NakamaModule, conf GameLiftConfig) (runtime.FleetManagerInitializer, error)
func NewInstanceInfo ¶
func NewInstanceInfo(gs types.GameSession) *runtime.InstanceInfo
Types ¶
type DeleteInstanceInfoRequest ¶
type DeleteInstanceInfoRequest struct {
Id string `json:"id"`
}
type GameLiftConfig ¶
type GameLiftConfig struct { NakamaNode string // Nakama node AwsKey string // AWS Key AwsSecret string // AWS Secret AwsRegion string // AWS Fleet Region AwsFleetAlias string // AWS GameLift Fleet Alias AwsPlacementQueueName string // AWS GameLift Placement Queue Name AwsPlacementEventsSqsUrl string // AWS GameLift Placement Events SQS Queue URL AwsGameLiftPollingPeriod time.Duration // Periodicity of the polling to the Aws GameLift APIs IndexMaxEntries int // Nakama storage index max entries - limits the number of game sessions that can be indexed. HttpRequestTimeout time.Duration // AWS Http Client request timeout HttpDialerTimeout time.Duration // AWS Http Client request dialing timeout SqsVisibilityTimeout time.Duration // AWS SQS Client Visibility Timeout SqsWaitTime time.Duration // AWS SQS Client Wait Time }
func NewGameLiftConfig ¶
func NewGameLiftConfig(awsKey, awsSecret, awsRegion, awsGameLiftFleetAlias, awsGameLiftPlacementQueueName, awsGameLiftPlacementEventsSqsUrl string) GameLiftConfig
func (*GameLiftConfig) Validate ¶
func (glc *GameLiftConfig) Validate() error
type GameLiftFleetManager ¶
type GameLiftFleetManager struct {
// contains filtered or unexported fields
}
func (*GameLiftFleetManager) Create ¶
func (fm *GameLiftFleetManager) Create(ctx context.Context, maxPlayers int, userIds []string, latencies []runtime.FleetUserLatencies, metadata map[string]any, callback runtime.FmCreateCallbackFn) error
func (*GameLiftFleetManager) Delete ¶
func (fm *GameLiftFleetManager) Delete(ctx context.Context, id string) error
func (*GameLiftFleetManager) DeleteInstanceInfo ¶
func (*GameLiftFleetManager) Get ¶
func (fm *GameLiftFleetManager) Get(ctx context.Context, id string) (instance *runtime.InstanceInfo, err error)
func (*GameLiftFleetManager) Init ¶
func (fm *GameLiftFleetManager) Init(nk runtime.NakamaModule, callbackHandler runtime.FmCallbackHandler) error
func (*GameLiftFleetManager) List ¶
func (fm *GameLiftFleetManager) List(ctx context.Context, query string, limit int, prevCursor string) (list []*runtime.InstanceInfo, nextCursor string, err error)
func (*GameLiftFleetManager) UpdateInstanceInfo ¶
type SqsMessage ¶
type SqsMessage struct { Type string `json:"Type"` MessageId string `json:"MessageId"` TopicArn string `json:"TopicArn"` Message string `json:"Message"` Timestamp time.Time `json:"Timestamp"` SignatureVersion string `json:"SignatureVersion"` Signature string `json:"Signature"` SigningCertURL string `json:"SigningCertURL"` UnsubscribeURL string `json:"UnsubscribeURL"` }
type SqsMessagePlacementEventBody ¶
type SqsMessagePlacementEventBody struct { Version string `json:"version"` Id string `json:"id"` DetailType string `json:"detail-type"` Source string `json:"source"` Account string `json:"account"` Time time.Time `json:"time"` Region string `json:"region"` Resources []string `json:"resources"` Detail struct { Type string `json:"type"` PlacementId string `json:"placementId"` Port string `json:"port"` GameSessionArn string `json:"gameSessionArn"` IpAddress string `json:"ipAddress"` DnsName string `json:"dnsName"` StartTime time.Time `json:"startTime"` EndTime time.Time `json:"endTime"` GameSessionRegion string `json:"gameSessionRegion"` PlacedPlayerSessions []struct { PlayerId string `json:"playerId"` PlayerSessionId string `json:"playerSessionId"` } `json:"placedPlayerSessions"` } `json:"detail"` }
Click to show internal directories.
Click to hide internal directories.