sdk

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sdk is the Go game server sdk

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameServerCallback added in v0.4.0

type GameServerCallback func(gs *sdk.GameServer)

GameServerCallback is a function definition to be called when a GameServer CRD has been changed

type SDK

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

SDK is an instance of the Agones SDK

func NewSDK

func NewSDK() (*SDK, error)

NewSDK starts a new SDK instance, and connects to localhost on port 59357. Blocks until connection and handshake are made. Times out after 30 seconds.

func (*SDK) GameServer added in v0.3.0

func (s *SDK) GameServer() (*sdk.GameServer, error)

GameServer retrieve the GameServer details

func (*SDK) Health

func (s *SDK) Health() error

Health sends a ping to the health check to indicate that this server is healthy

func (*SDK) Ready

func (s *SDK) Ready() error

Ready marks the Game Server as ready to receive connections

func (*SDK) SetAnnotation added in v0.4.0

func (s *SDK) SetAnnotation(key, value string) error

SetAnnotation sets a metadata annotation on the `GameServer` with the prefix stable.agones.dev/sdk-

func (*SDK) SetLabel added in v0.4.0

func (s *SDK) SetLabel(key, value string) error

SetLabel sets a metadata label on the `GameServer` with the prefix stable.agones.dev/sdk-

func (*SDK) Shutdown

func (s *SDK) Shutdown() error

Shutdown marks the Game Server as ready to shutdown

func (*SDK) WatchGameServer added in v0.4.0

func (s *SDK) WatchGameServer(f GameServerCallback) error

WatchGameServer asynchronously calls the given GameServerCallback with the current GameServer configuration when the backing GameServer configuration is updated. This function can be called multiple times to add more than one GameServerCallback.

Jump to

Keyboard shortcuts

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