Documentation
¶
Overview ¶
Package sdk is the Go game server sdk
Index ¶
- type Alpha
- type GameServerCallback
- type SDK
- func (s *SDK) Allocate() error
- func (s *SDK) Alpha() *Alpha
- func (s *SDK) GameServer() (*sdk.GameServer, error)
- func (s *SDK) Health() error
- func (s *SDK) Ready() error
- func (s *SDK) Reserve(d time.Duration) error
- func (s *SDK) SetAnnotation(key, value string) error
- func (s *SDK) SetLabel(key, value string) error
- func (s *SDK) Shutdown() error
- func (s *SDK) WatchGameServer(f GameServerCallback) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alpha ¶ added in v1.5.0
type Alpha struct {
// contains filtered or unexported fields
}
Alpha is the struct for Alpha SDK functionality
func (*Alpha) GetPlayerCapacity ¶ added in v1.5.0
GetPlayerCapacity gets the last player capacity that was set through the SDK. If the player capacity is set from outside the SDK, use SDK.GameServer() instead.
func (*Alpha) SetPlayerCapacity ¶ added in v1.5.0
SetPlayerCapacity changes the player capacity to a new value
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 ¶
NewSDK starts a new SDK instance, and connects to localhost on port 9357. 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 ¶
Health sends a ping to the health check to indicate that this server is healthy
func (*SDK) Reserve ¶ added in v0.12.0
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 ¶ added in v0.4.0
SetAnnotation sets a metadata annotation on the `GameServer` with the prefix stable.agones.dev/sdk-
func (*SDK) SetLabel ¶ added in v0.4.0
SetLabel sets a metadata label on the `GameServer` with the prefix stable.agones.dev/sdk-
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.