Documentation ¶
Index ¶
- Constants
- func Bool2Str(state bool) string
- func Convert_Carrier_To_GRPC(gs *carrierv1.GameServer) *sdkapi.GameServer
- func GetContainer(spec *corev1.PodSpec) *corev1.Container
- func GetGameServerCondition(status carrierv1.GameServerStatus, condType carrierv1.GameServerConditionType) *carrierv1.GameServerCondition
- func GetWebhookConfigName(gs *carrierv1.GameServer) string
- func SetGameServerCondition(status *carrierv1.GameServerStatus, condition carrierv1.GameServerCondition)
- func SetRequestToGameServerCondition(req SetRequest) (*carrierv1.GameServerCondition, error)
- func SetupSignalHandler() <-chan struct{}
- func WithExponentialBackoff(initialBackoff time.Duration, webhookFn func() error) error
- type BoolValue
- type KeyValue
- type SetRequest
- type SetType
Constants ¶
const ( WebhookAnn = "carrier.ocgi.dev/webhook-config-name" ReadinessWebhook = "ReadinessWebhook" DeletableWebhook = "DeletableWebhook" ConstraintWebhook = "ConstraintWebhook" )
Variables ¶
This section is empty.
Functions ¶
func Convert_Carrier_To_GRPC ¶
func Convert_Carrier_To_GRPC(gs *carrierv1.GameServer) *sdkapi.GameServer
Convert_Carrier_To_GRPC converts a K8s GameServer object, into a gRPC SDK GameServer object
func GetContainer ¶
GetContainer returns the container name
func GetGameServerCondition ¶
func GetGameServerCondition(status carrierv1.GameServerStatus, condType carrierv1.GameServerConditionType) *carrierv1.GameServerCondition
GetGameServerCondition returns the condition with the provided type.
func GetWebhookConfigName ¶
func GetWebhookConfigName(gs *carrierv1.GameServer) string
GetWebhookConfigName returns webhook name according to annotations.
func SetGameServerCondition ¶
func SetGameServerCondition(status *carrierv1.GameServerStatus, condition carrierv1.GameServerCondition)
SetGameServerCondition updates the GameServer to include the provided condition. If the condition that we are about to add already exists and has the same status, then we are not going to update.
func SetRequestToGameServerCondition ¶
func SetRequestToGameServerCondition(req SetRequest) (*carrierv1.GameServerCondition, error)
SetRequestToGameServerCondition convert request to GameServer condition
func SetupSignalHandler ¶
func SetupSignalHandler() <-chan struct{}
SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.
Types ¶
type BoolValue ¶
type BoolValue struct {
Value bool
}
BoolValue for the request only contain bool field, such as SetReady request.
type SetRequest ¶
SetRequest is the request from game server.