Documentation ¶
Overview ¶
Package sdkgo 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 ¶
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 Carrier SDK
func NewSDK ¶
NewSDK starts a new SDK instance, and connects to localhost on port 9020. Blocks until connection and handshake are made. Times out after 30 seconds.
func (*SDK) GameServer ¶
func (s *SDK) GameServer() (*sdk.GameServer, error)
GameServer retrieve the GameServer details
func (*SDK) SetAnnotation ¶
SetAnnotation sets a metadata annotation on the `GameServer` with the prefix carrier.ocgi.dev/sdk-
func (*SDK) SetCondition ¶
SetCondition sets a condition on the `GameServer`
func (*SDK) SetLabel ¶
SetLabel sets a metadata label on the `GameServer` with the prefix carrier.ocgi.dev/sdk-
func (*SDK) WatchGameServer ¶
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.