json

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2017 License: Apache-2.0 Imports: 2 Imported by: 13

Documentation

Index

Constants

View Source
const (
	INIT_VERSION = iota // 0
	INIT_STARTPOD
	INIT_GETPOD_DEPRECATED
	INIT_STOPPOD_DEPRECATED
	INIT_DESTROYPOD
	INIT_RESTARTCONTAINER_DEPRECATED // 5
	INIT_EXECCMD
	INIT_FINISHCMD_DEPRECATED
	INIT_READY
	INIT_ACK
	INIT_ERROR // 10
	INIT_WINSIZE
	INIT_PING
	INIT_FINISHPOD_DEPRECATED
	INIT_NEXT
	INIT_WRITEFILE // 15
	INIT_READFILE
	INIT_NEWCONTAINER
	INIT_KILLCONTAINER
	INIT_ONLINECPUMEM
	INIT_SETUPINTERFACE // 20
	INIT_SETUPROUTE
	INIT_REMOVECONTAINER
	INIT_PROCESSASYNCEVENT
	INIT_SIGNALPROCESS
)
View Source
const HYPERSTART_EXEC_CONTAINER = "hyperstart"

"hyperstart" is the special container ID for adding processes.

View Source
const HYPER_P9_USE_XEN = "hyper_p9_xen"
View Source
const HYPER_USE_SERIAL = "hyper_use_serial"
View Source
const HYPER_VSOCK_CTL_PORT = 2718
View Source
const HYPER_VSOCK_MSG_PORT = 2719
View Source
const VERSION = 4244

when APIVERSION < 1000000, the version MUST be exactly matched on both sides

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Id            string              `json:"id"`
	Rootfs        string              `json:"rootfs"`
	Fstype        string              `json:"fstype,omitempty"`
	Image         string              `json:"image"`
	Addr          string              `json:"addr,omitempty"`
	Volumes       []*VolumeDescriptor `json:"volumes,omitempty"`
	Fsmap         []*FsmapDescriptor  `json:"fsmap,omitempty"`
	Sysctl        map[string]string   `json:"sysctl,omitempty"`
	Process       *Process            `json:"process"`
	RestartPolicy string              `json:"restartPolicy"`
	Initialize    bool                `json:"initialize"`
	ReadOnly      bool                `json:"readOnly"`
	Ports         []Port              `json:"ports,omitempty"` //deprecated
}

func (*Container) RoLookup

func (cr *Container) RoLookup(mpoint string) bool

type DecodedMessage

type DecodedMessage struct {
	Code    uint32
	Message []byte
}

Message

type EnvironmentVar

type EnvironmentVar struct {
	Env   string `json:"env"`
	Value string `json:"value"`
}

type ExecCommand

type ExecCommand struct {
	Container string  `json:"container,omitempty"`
	Process   Process `json:"process"`
}

type FileCommand

type FileCommand struct {
	Container string `json:"container"`
	File      string `json:"file"`
}

type FsmapDescriptor

type FsmapDescriptor struct {
	Source       string `json:"source"`
	Path         string `json:"path"`
	ReadOnly     bool   `json:"readOnly"`
	DockerVolume bool   `json:"dockerVolume"`
}

type IpAddress added in v1.0.0

type IpAddress struct {
	IpAddress string `json:"ipAddress"`
	NetMask   string `json:"netMask"`
}

type KillCommand

type KillCommand struct {
	Container string         `json:"container"`
	Signal    syscall.Signal `json:"signal"`
}

type NetworkInf

type NetworkInf struct {
	Device      string      `json:"device"`
	IpAddress   string      `json:"ipAddress,omitempty"`
	NetMask     string      `json:"netMask,omitempty"`
	IpAddresses []IpAddress `json:"ipAddresses"`
}

type Pod

type Pod struct {
	Hostname              string                `json:"hostname"`
	DeprecatedContainers  []Container           `json:"containers,omitempty"`
	DeprecatedInterfaces  []NetworkInf          `json:"interfaces,omitempty"`
	Dns                   []string              `json:"dns,omitempty"`
	DnsOptions            []string              `json:"dnsOptions,omitempty"`
	DnsSearch             []string              `json:"dnsSearch,omitempty"`
	DeprecatedRoutes      []Route               `json:"routes,omitempty"`
	ShareDir              string                `json:"shareDir"`
	PortmappingWhiteLists *PortmappingWhiteList `json:"portmappingWhiteLists,omitempty"`
}

type Port added in v0.6.2

type Port struct {
	HostPort      int    `json:"hostPort"`
	ContainerPort int    `json:"containerPort"`
	Protocol      string `json:"protocol"`
}

type PortmappingWhiteList added in v0.6.2

type PortmappingWhiteList struct {
	InternalNetworks []string `json:"internalNetworks,omitempty"`
	ExternalNetworks []string `json:"externalNetworks,omitempty"`
}

type Process

type Process struct {
	// Process Id
	Id string `json:"id"`
	// User, Group, AdditionalGroups specify the user information
	User             string   `json:"user,omitempty"`
	Group            string   `json:"group,omitempty"`
	AdditionalGroups []string `json:"additionalGroups,omitempty"`
	// Terminal creates an interactive terminal for the process.
	Terminal bool `json:"terminal"`
	// Sequeue number for stdin and stdout
	Stdio uint64 `json:"stdio,omitempty"`
	// sequeue number for stderr if it is not shared with stdout
	Stderr uint64 `json:"stderr,omitempty"`
	// Args specifies the binary and arguments for the application to execute.
	Args []string `json:"args"`
	// Envs populates the process environment for the process.
	Envs []EnvironmentVar `json:"envs,omitempty"`
	// Workdir is the current working directory for the process and must be
	// relative to the container's root.
	Workdir string `json:"workdir"`
	// Rlimits specifies rlimit options to apply to the process.
	Rlimits []Rlimit `json:"rlimits,omitempty"`
}

type ProcessAsyncEvent added in v0.8.0

type ProcessAsyncEvent struct {
	Container string `json:"container"`
	Process   string `json:"process"`
	Event     string `json:"event"` // curent supported events: finished
	Info      string `json:"info,omitempty"`
	Status    int    `json:"status,omitempty"`
}

type Rlimit added in v0.8.0

type Rlimit struct {
	// Type of the rlimit to set
	Type string `json:"type"`
	// Hard is the hard limit for the specified type
	Hard uint64 `json:"hard"`
	// Soft is the soft limit for the specified type
	Soft uint64 `json:"soft"`
}

Rlimit type and restrictions

type Route

type Route struct {
	Dest    string `json:"dest"`
	Gateway string `json:"gateway,omitempty"`
	Device  string `json:"device,omitempty"`
}

type Routes added in v0.6.2

type Routes struct {
	Routes []Route `json:"routes,omitempty"`
}

type SignalCommand added in v0.8.0

type SignalCommand struct {
	Container string         `json:"container"`
	Process   string         `json:"process"`
	Signal    syscall.Signal `json:"signal"`
}

type TtyMessage

type TtyMessage struct {
	Session uint64
	Message []byte
}

func (*TtyMessage) ToBuffer

func (tm *TtyMessage) ToBuffer() []byte

type VolumeDescriptor

type VolumeDescriptor struct {
	Device       string `json:"device"`
	Addr         string `json:"addr,omitempty"`
	Mount        string `json:"mount"`
	Fstype       string `json:"fstype,omitempty"`
	ReadOnly     bool   `json:"readOnly"`
	DockerVolume bool   `json:"dockerVolume"`
}

type WindowSizeMessage added in v0.6.2

type WindowSizeMessage struct {
	Container string `json:"container"`
	Process   string `json:"process"`
	Row       uint16 `json:"row"`
	Column    uint16 `json:"column"`
}

Jump to

Keyboard shortcuts

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