Documentation ¶
Overview ¶
Package sdkserver implements Agones SDK server (sidecar).
Index ¶
- func EqualSets(a, b []string) bool
- type LocalSDKServer
- func (l *LocalSDKServer) Allocate(context.Context, *sdk.Empty) (*sdk.Empty, error)
- func (l *LocalSDKServer) Close()
- func (l *LocalSDKServer) GenerateUID()
- func (l *LocalSDKServer) GetGameServer(context.Context, *sdk.Empty) (*sdk.GameServer, error)
- func (l *LocalSDKServer) Health(stream sdk.SDK_HealthServer) error
- func (l *LocalSDKServer) Ready(context.Context, *sdk.Empty) (*sdk.Empty, error)
- func (l *LocalSDKServer) Reserve(ctx context.Context, d *sdk.Duration) (*sdk.Empty, error)
- func (l *LocalSDKServer) SetAnnotation(_ context.Context, kv *sdk.KeyValue) (*sdk.Empty, error)
- func (l *LocalSDKServer) SetExpectedSequence(sequence []string)
- func (l *LocalSDKServer) SetLabel(_ context.Context, kv *sdk.KeyValue) (*sdk.Empty, error)
- func (l *LocalSDKServer) SetTestMode(testMode bool)
- func (l *LocalSDKServer) Shutdown(context.Context, *sdk.Empty) (*sdk.Empty, error)
- func (l *LocalSDKServer) WatchGameServer(_ *sdk.Empty, stream sdk.SDK_WatchGameServerServer) error
- type Operation
- type SDKServer
- func (s *SDKServer) Allocate(ctx context.Context, e *sdk.Empty) (*sdk.Empty, error)
- func (s *SDKServer) GetGameServer(context.Context, *sdk.Empty) (*sdk.GameServer, error)
- func (s *SDKServer) Health(stream sdk.SDK_HealthServer) error
- func (s *SDKServer) Ready(ctx context.Context, e *sdk.Empty) (*sdk.Empty, error)
- func (s *SDKServer) Reserve(ctx context.Context, d *sdk.Duration) (*sdk.Empty, error)
- func (s *SDKServer) Run(stop <-chan struct{}) error
- func (s *SDKServer) SetAnnotation(_ context.Context, kv *sdk.KeyValue) (*sdk.Empty, error)
- func (s *SDKServer) SetLabel(_ context.Context, kv *sdk.KeyValue) (*sdk.Empty, error)
- func (s *SDKServer) Shutdown(ctx context.Context, e *sdk.Empty) (*sdk.Empty, error)
- func (s *SDKServer) WatchGameServer(_ *sdk.Empty, stream sdk.SDK_WatchGameServerServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalSDKServer ¶
type LocalSDKServer struct {
// contains filtered or unexported fields
}
LocalSDKServer type is the SDKServer implementation for when the sidecar is being run for local development, and doesn't connect to the Kubernetes cluster
func NewLocalSDKServer ¶
func NewLocalSDKServer(filePath string) (*LocalSDKServer, error)
NewLocalSDKServer returns the default LocalSDKServer
func (*LocalSDKServer) Allocate ¶ added in v0.10.0
Allocate logs that an allocate request has been received
func (*LocalSDKServer) GenerateUID ¶ added in v0.12.0
func (l *LocalSDKServer) GenerateUID()
GenerateUID - generate gameserver UID at random for testing
func (*LocalSDKServer) GetGameServer ¶
func (l *LocalSDKServer) GetGameServer(context.Context, *sdk.Empty) (*sdk.GameServer, error)
GetGameServer returns current GameServer configuration.
func (*LocalSDKServer) Health ¶
func (l *LocalSDKServer) Health(stream sdk.SDK_HealthServer) error
Health logs each health ping that comes down the stream
func (*LocalSDKServer) Reserve ¶ added in v0.12.0
Reserve moves this GameServer to the Reserved state for the Duration specified
func (*LocalSDKServer) SetAnnotation ¶
SetAnnotation applies a Annotation to the backing GameServer metadata
func (*LocalSDKServer) SetExpectedSequence ¶ added in v0.12.0
func (l *LocalSDKServer) SetExpectedSequence(sequence []string)
SetExpectedSequence set expected request sequence which would be verified against after run was completed
func (*LocalSDKServer) SetTestMode ¶ added in v0.12.0
func (l *LocalSDKServer) SetTestMode(testMode bool)
SetTestMode set test mode to collect the sequence of performed requests
func (*LocalSDKServer) WatchGameServer ¶
func (l *LocalSDKServer) WatchGameServer(_ *sdk.Empty, stream sdk.SDK_WatchGameServerServer) error
WatchGameServer will return current GameServer configuration, 3 times, every 5 seconds
type SDKServer ¶
type SDKServer struct {
// contains filtered or unexported fields
}
SDKServer is a gRPC server, that is meant to be a sidecar for a GameServer that will update the game server status on SDK requests nolint: maligned
func NewSDKServer ¶
func NewSDKServer(gameServerName, namespace string, kubeClient kubernetes.Interface, agonesClient versioned.Interface) (*SDKServer, error)
NewSDKServer creates a SDKServer that sets up an InClusterConfig for Kubernetes
func (*SDKServer) Allocate ¶ added in v0.10.0
Allocate enters an Allocate state change into the workqueue, so it can be updated
func (*SDKServer) GetGameServer ¶
GetGameServer returns the current GameServer configuration and state from the backing GameServer CRD
func (*SDKServer) Health ¶
func (s *SDKServer) Health(stream sdk.SDK_HealthServer) error
Health receives each health ping, and tracks the last time the health check was received, to track if a GameServer is healthy
func (*SDKServer) Ready ¶
Ready enters the RequestReady state change for this GameServer into the workqueue so it can be updated
func (*SDKServer) Reserve ¶ added in v0.12.0
Reserve moves this GameServer to the Reserved state for the Duration specified
func (*SDKServer) SetAnnotation ¶
SetAnnotation adds the Key/Value to be used to set the annotations with the metadataPrefix to the `GameServer` metdata
func (*SDKServer) SetLabel ¶
SetLabel adds the Key/Value to be used to set the label with the metadataPrefix to the `GameServer` metdata
func (*SDKServer) Shutdown ¶
Shutdown enters the Shutdown state change for this GameServer into the workqueue so it can be updated
func (*SDKServer) WatchGameServer ¶
WatchGameServer sends events through the stream when changes occur to the backing GameServer configuration / status