agones: agones.dev/agones/sdks/go Index | Files

package sdk

import "agones.dev/agones/sdks/go"

Package sdk is the Go game server sdk

Index

Package Files

sdk.go

type GameServerCallback Uses

type GameServerCallback func(gs *sdk.GameServer)

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

type SDK Uses

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

SDK is an instance of the Agones SDK

func NewSDK Uses

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) Allocate Uses

func (s *SDK) Allocate() error

Allocate self marks this gameserver as Allocated.

func (*SDK) GameServer Uses

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

GameServer retrieve the GameServer details

func (*SDK) Health Uses

func (s *SDK) Health() error

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

func (*SDK) Ready Uses

func (s *SDK) Ready() error

Ready marks the Game Server as ready to receive connections

func (*SDK) Reserve Uses

func (s *SDK) Reserve(d time.Duration) error

Reserve marks the Game Server as Reserved for a given duration, at which point it will return the GameServer to a Ready state. Do note, the smallest unit available in the time.Duration argument is a second.

func (*SDK) SetAnnotation Uses

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 Uses

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 Uses

func (s *SDK) Shutdown() error

Shutdown marks the Game Server as ready to shutdown

func (*SDK) WatchGameServer Uses

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.

Package sdk imports 7 packages (graph) and is imported by 2 packages. Updated 2019-07-17. Refresh now. Tools for package owners.