spec

package
v0.0.0-...-34aeca7 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const STATE_CREATED = 0
View Source
const STATE_DEAD = 4
View Source
const STATE_EXITED = 2
View Source
const STATE_RESTARTING = 3
View Source
const STATE_RUNNING = 1
View Source
const YC_KEY_CONTAINER_END = 0x1ffff
View Source
const YC_KEY_CONTAINER_START = 0x10000
View Source
const YC_KEY_EXEC_END = 0x2ffff
View Source
const YC_KEY_EXEC_START = 0x20000
View Source
const YC_KEY_SHUTDOWN = 0x104
View Source
const YC_KEY_STARTUP = 0x101
View Source
const YC_SUB_CLOSE_STDERR = 0x13
View Source
const YC_SUB_CLOSE_STDIN = 0x11
View Source
const YC_SUB_CLOSE_STDOUT = 0x12
View Source
const YC_SUB_EXEC = 0x5
View Source
const YC_SUB_SIGNAL = 0x6
View Source
const YC_SUB_STATE = 0x6
View Source
const YC_SUB_STDERR = 0x3
View Source
const YC_SUB_STDIN = 0x1
View Source
const YC_SUB_STDOUT = 0x2
View Source
const YC_SUB_WINCH = 0x4

Variables

This section is empty.

Functions

func YKContainer

func YKContainer(container uint8, subkey uint8) uint32

func YKExec

func YKExec(exec uint8, subkey uint8) uint32

Types

type BindMount

type BindMount struct {

	// path on host
	HostPath string `json:"host_path"`

	// path inside container
	GuestPath string `json:"guest_path"`

	// read only
	ReadOnly bool `json:"read_only"`
}

type ConfigMount

type ConfigMount struct {

	// path inside container
	GuestPath string `json:"guest_path"`

	// perms
	GID string `json:"gid"`
	// perms
	UID string `json:"uid"`
	// perms
	Mode uint32 `json:"mode"`

	// content
	Content []byte `json:"content"`
}

type Container

type Container struct {

	// uuid
	ID string `json:"id"`

	// api name
	Name string `json:"name"`

	// hostname inside container
	Hostname string `json:"hostname"`

	// image config
	Image Image `json:"image"`

	// main process config
	Process Process `json:"process"`

	// lifecycle of container
	Lifecycle Lifecycle `json:"lifecycle"`

	// mount volumes
	VolumeMounts []VolumeMount `json:"block_volume_mounts,omitempty"`

	// mount cradle host paths into container
	BindMounts []BindMount `json:"bind_mounts,omitempty"`

	// k8s config objects
	ConfigMounts []ConfigMount `json:"config_mounts,omitempty"`
}

the container spec

type ControlMessageExec

type ControlMessageExec struct {
	Host       bool     `json:"host,omitempty"`
	Container  uint8    `json:"container"`
	Cmd        []string `json:"cmd"`
	WorkingDir string   `json:"cwd"`
	Env        []string `json:"env"`
	Tty        bool     `json:"tty"`
	ArchiveCmd bool     `json:"archivecmd,omitempty"`
	ProxyCmd   bool     `json:"proxycmd,omitempty"`
}

type ControlMessageResize

type ControlMessageResize struct {
	Rows    uint16 `json:"row"`
	Cols    uint16 `json:"col"`
	XPixels uint16 `json:"xpixel"`
	YPixels uint16 `json:"ypixel"`
}

type ControlMessageSignal

type ControlMessageSignal struct {
	Signal int32 `json:"sig"`
}

type ControlMessageState

type ControlMessageState struct {
	StateNum uint8  `json:"statenum"`
	Code     int32  `json:"code"`
	Error    string `json:"error"`
}

func (*ControlMessageState) StateString

func (s *ControlMessageState) StateString() string

type Cradle

type Cradle struct {
	Version  int      `json:"version"`
	Firmware Firmware `json:"firmware"`
	Kernel   Kernel   `json:"kernel"`
	Machine  Machine  `json:"machine"`
}

type Firmware

type Firmware struct {
	PFlash0 string `json:"pflash0"`
	PFlash1 string `json:"pflash1"`
}

type Image

type Image struct {

	// image uuid
	ID string `json:"id"`

	// layers
	Layers []Layer `json:"layers"`
}

type Kernel

type Kernel struct {
	Kernel string `json:"kernel"`
	Initrd string `json:"initrd"`
}

type Launch

type Launch struct {
	// version of spec. currently 2
	Version int `json:"version"`

	// uuid of pod
	ID string `json:"id"`

	Pod *Pod `json:"pod,omitempty"`

	Network *Network `json:"network,omitempty"`

	Role *Role `json:"role,omitempty"`
}

the interior launch spec

type Layer

type Layer struct {

	// layer uuid
	ID string `json:"id"`

	// sha of compressed layer data (usually tar.gz)
	Sha256 string `json:"sha256"`

	// OCI image id, sha of uncompressed tar
	Digest string `json:"digest"`
}

type Lifecycle

type Lifecycle struct {

	// should container restart with exit code 0
	RestartOnSuccess bool `json:"restart_on_success"`

	// should container restart with exit code != 0
	RestartOnFailure bool `json:"restart_on_failure"`

	// delay restarts by this amount of milliseconds
	RestartDelay uint64 `json:"restart_delay"`

	// give up after starting this many times.
	// note that the first start counts too
	// 1 means never restart after initial launch
	// 0 means infinite
	MaxRestarts int `json:"max_restarts"`

	// fail entire pod when maxrestarts is reached
	Critical bool `json:"critical"`
}

type Machine

type Machine struct {
	Type string `json:"type"`
}

type Network

type Network struct {
	Nameservers []string `json:"nameservers,omitempty"`

	FabricIp6 string `json:"fip6,omitempty"`
	FabricGw6 string `json:"fgw6,omitempty"`

	TransitIp4 string `json:"tip4,omitempty"`
	TransitGw4 string `json:"tgw4,omitempty"`

	TransitIp6 string `json:"tip6,omitempty"`
	TransitGw6 string `json:"tgw6,omitempty"`

	PublicIPs []string `json:"public_ips,omitempty"`
}

type Pod

type Pod struct {

	// api name of pod
	Name string `json:"name"`

	// api namespace of pod
	Namespace string `json:"namespace"`

	// block volumes provided by the hypervisor
	Volumes []Volume `json:"block_volumes,omitempty"`

	// the containers inside the pod
	Containers []Container `json:"containers,omitempty"`
}

pod to be launched in cradle

type Process

type Process struct {

	// command and arguments
	Cmd []string `json:"cmd"`

	// environment variables
	Env map[string]string `json:"env"`

	// working directory
	Workdir string `json:"workdir"`

	// run in pty
	Tty bool `json:"tty"`

	// User to run as. defaults to 0
	User string `json:"user,omitempty"`
}

type Role

type Role struct {
	Api   []string `json:"api,omitempty"`
	Token string   `json:"token,omitempty"`
}

type Volume

type Volume struct {

	// uuid of block volume
	ID string `json:"id"`

	// name referenced inside container
	Name string `json:"name"`

	// storage class
	Class string `json:"class"`

	// hvm transport mode
	Transport string `json:"transport"`

	// local storage pool
	Filesystem string `json:"filesystem"`

	// expected size in bytes
	Size uint64 `json:"size"`
}

a volume provided by the hypervisor

type VolumeMount

type VolumeMount struct {

	// name of block volume
	VolumeName string `json:"block_volume_name"`

	// path inside the volume
	VolumePath string `json:"volume_path"`

	// path inside the container
	GuestPath string `json:"guest_path"`

	// read only
	ReadOnly bool `json:"read_only"`
}

Jump to

Keyboard shortcuts

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