v1

package
v0.0.0-...-608c54b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: AGPL-3.0 Imports: 6 Imported by: 5

Documentation

Overview

+kubebuilder:object:generate=true +groupName=instance.cow.network

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "instance.cow.network", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Instance

type Instance struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   InstanceSpec   `json:"spec,omitempty"`
	Status InstanceStatus `json:"status,omitempty"`
}

Instance is the Schema for the instances API

func (*Instance) DeepCopy

func (in *Instance) DeepCopy() *Instance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance.

func (*Instance) DeepCopyInto

func (in *Instance) DeepCopyInto(out *Instance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Instance) DeepCopyObject

func (in *Instance) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InstanceList

type InstanceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Instance `json:"items"`
}

InstanceList contains a list of Instance

func (*InstanceList) DeepCopy

func (in *InstanceList) DeepCopy() *InstanceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceList.

func (*InstanceList) DeepCopyInto

func (in *InstanceList) DeepCopyInto(out *InstanceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*InstanceList) DeepCopyObject

func (in *InstanceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InstanceMetadata

type InstanceMetadata struct {
	// State holds the current observed state of the application.
	State json.RawMessage `json:"state,omitempty"`

	// Players currently connected to this Instance.
	Players []InstancePlayer `json:"players,omitempty"`
}

InstanceMetadata defines the metadata of the Instance

func (*InstanceMetadata) DeepCopy

func (in *InstanceMetadata) DeepCopy() *InstanceMetadata

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceMetadata.

func (*InstanceMetadata) DeepCopyInto

func (in *InstanceMetadata) DeepCopyInto(out *InstanceMetadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstancePlayer

type InstancePlayer struct {
	// ID of this player
	ID string `json:"id"`

	// Metadata contains custom metadata about this player
	Metadata json.RawMessage `json:"metadata,omitempty"`
}

InstancePlayer defines metadata of a player connected to this instance

func (*InstancePlayer) DeepCopy

func (in *InstancePlayer) DeepCopy() *InstancePlayer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstancePlayer.

func (*InstancePlayer) DeepCopyInto

func (in *InstancePlayer) DeepCopyInto(out *InstancePlayer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceSpec

type InstanceSpec struct {
	// Template defines the underlying pod that will be started when creating the Instance
	Template corev1.PodSpec `json:"template"`
}

InstanceSpec defines the desired state of Instance

func (*InstanceSpec) DeepCopy

func (in *InstanceSpec) DeepCopy() *InstanceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec.

func (*InstanceSpec) DeepCopyInto

func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InstanceState

type InstanceState string

InstanceState is the current observed state of the instance It is restricted to Initializing, Running and Ending Applications can register their custom States in InstanceMetadata +kubebuilder:validation:Enum=Initializing;Running;Ending

const (
	// InitializingState indicates that the Instance is starting.
	// Players should not be able to connect at this point.
	StateInitializing InstanceState = "Initializing"

	// StateRunning indicates that initialization has been completed an players
	// can or have already connected.
	StateRunning InstanceState = "Running"

	// EndingState indicates that the Instance is about to shutdown.
	// At this stage it should be save to kill the Instance at any point.
	StateEnding InstanceState = "Ending"
)

type InstanceStatus

type InstanceStatus struct {

	// State holds the current observed state of the instance
	State InstanceState `json:"state,omitempty"`

	// IP address assigned to the Instance
	IP string `json:"ip,omitempty"`

	// Unique ID of the instance
	ID string `json:"id,omitempty"`

	// Metadata holds application specific metadata about the instance
	Metadata InstanceMetadata `json:"metadata,omitempty"`
}

InstanceStatus defines the observed state of Instance

func (*InstanceStatus) DeepCopy

func (in *InstanceStatus) DeepCopy() *InstanceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus.

func (*InstanceStatus) DeepCopyInto

func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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