agones

package
v0.0.0-...-15cdd5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultGameServerContainerName        = "gameserver"
	DefaultGameServerSidecarContainerName = "agones-gameserver-sidecar"
	DefaultGameServerPortName             = "udp"
	DefaultGameServerPort                 = 7777
	SimpleGameServerImage                 = "gcr.io/pixo-bootstrap/multiplayer/gameservers/simple-server:latest"

	DeletedGameServerLabel = "agones.dev/deleted"
)

Variables

View Source
var (
	GameServerTolerations = []corev1.Toleration{
		{
			Effect:   "NoExecute",
			Key:      "gameserver",
			Operator: "Equal",
			Value:    "true",
		},
	}

	SimpleGameServer = agonesv1.GameServer{
		ObjectMeta: metav1.ObjectMeta{
			GenerateName: "test-gameserver-",
			Labels: labels.Set{
				"agones.dev/sdk-OrgID":    "1",
				"agones.dev/sdk-ModuleID": "1",
			},
		},
		Spec: agonesv1.GameServerSpec{
			Container: "simplegameserver",
			Ports: []agonesv1.GameServerPort{{
				Name:          DefaultGameServerPortName,
				ContainerPort: DefaultGameServerPort,
				Protocol:      corev1.ProtocolUDP,
				PortPolicy:    agonesv1.Dynamic,
			}},
			Template: corev1.PodTemplateSpec{
				Spec: corev1.PodSpec{
					Tolerations: GameServerTolerations,
					Containers: []corev1.Container{
						{
							Name:            DefaultGameServerContainerName,
							Image:           SimpleGameServerImage,
							ImagePullPolicy: corev1.PullAlways,
							Resources: corev1.ResourceRequirements{
								Requests: corev1.ResourceList{},
							},
						},
					},
				},
			},
		},
	}
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*versioned.Clientset
	//client     rest.Interface
	BaseClient base.Client
}

func NewInClusterAgonesClient

func NewInClusterAgonesClient(baseClient base.Client) (Client, error)

func NewLocalAgonesClient

func NewLocalAgonesClient(baseClient base.Client) (Client, error)

func (Client) AddLabelToGameServer

func (c Client) AddLabelToGameServer(ctx context.Context, gameserver *v1.GameServer, key, value string) (*v1.GameServer, error)

func (Client) CreateFleet

func (c Client) CreateFleet(ctx context.Context, namespace string, fleet *v1.Fleet) (*v1.Fleet, error)

func (Client) CreateFleetAutoscaler

func (c Client) CreateFleetAutoscaler(ctx context.Context, namespace string, autoscaler *autoscaling.FleetAutoscaler) (*autoscaling.FleetAutoscaler, error)

func (Client) CreateGameServer

func (c Client) CreateGameServer(ctx context.Context, namespace string, gameserver *v1.GameServer) (*v1.GameServer, error)

func (Client) CreateGameServerAllocation

func (c Client) CreateGameServerAllocation(ctx context.Context, namespace string, allocation *allocationv1.GameServerAllocation) (*allocationv1.GameServerAllocation, error)

func (Client) DeleteFleet

func (c Client) DeleteFleet(ctx context.Context, namespace, name string) error

func (Client) DeleteFleetAutoscaler

func (c Client) DeleteFleetAutoscaler(ctx context.Context, namespace string, name string) error

func (Client) DeleteGameServer

func (c Client) DeleteGameServer(ctx context.Context, namespace, name string) error

func (Client) GetFleet

func (c Client) GetFleet(namespace, name string) (*v1.Fleet, error)

func (Client) GetFleetAutoscaler

func (c Client) GetFleetAutoscaler(ctx context.Context, namespace string, name string) (*autoscaling.FleetAutoscaler, error)

func (Client) GetFleetsBySelectors

func (c Client) GetFleetsBySelectors(namespace string, labelSelectors *metav1.LabelSelector) (*v1.FleetList, error)

func (Client) GetGameServer

func (c Client) GetGameServer(ctx context.Context, namespace, name string) (*agonesv1.GameServer, error)

func (Client) GetGameServerByName

func (c Client) GetGameServerByName(ctx context.Context, namespace, name string) (*agonesv1.GameServer, error)

func (Client) GetGameServerLogs

func (c Client) GetGameServerLogs(ctx context.Context, baseClient *base.Client, namespace string, gs agonesv1.GameServer) (string, string, error)

func (Client) GetGameServers

func (c Client) GetGameServers(ctx context.Context, namespace string, labelSelectors labels.Set) (*agonesv1.GameServerList, error)

func (Client) IsGameServerAvailable

func (c Client) IsGameServerAvailable(ctx context.Context, namespace, name string) bool

func (Client) IsGameServerReady

func (c Client) IsGameServerReady(ctx context.Context, namespace, name string) (*agonesv1.GameServer, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL