facade

package
v0.0.0-...-28e6f37 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContainer

func CreateContainer(runtimeRoot string, id string, bundle string, spec *specs.Spec, network string, portMappings []string) (libcapsule.Container, error)

创建容器实例

func CreateOrRunContainer

func CreateOrRunContainer(runtimeRoot string, id string, bundle string, spec *specs.Spec, action ContainerAction, detach bool, network string, portMappings []string) error

创建或启动容器 create or create and start Process一定为Init Process

func ExecContainer

func ExecContainer(runtimeRoot string, id string, detach bool, args []string, cwd string, env []string) (string, error)

进入容器执行一个Process

func GetContainer

func GetContainer(runtimeRoot, id string) (libcapsule.Container, error)

根据id读取一个Container

func GetContainerIds

func GetContainerIds(runtimeRoot string) ([]string, error)

查询所有的id

func LoadSpec

func LoadSpec(bundle string) (spec *specs.Spec, err error)

Types

type ContainerAction

type ContainerAction uint8
const (
	ContainerActCreate ContainerAction = iota
	ContainerActRun
)

func (ContainerAction) String

func (action ContainerAction) String() string

type ContainerStateVO

type ContainerStateVO struct {
	// Version is the OCI version for the container
	Version string `json:"ociVersion"`
	// ID is the container ID
	ID string `json:"id"`
	// InitProcessPid is the init process id in the parent namespace
	InitProcessPid int `json:"pid"`
	// ContainerStatus is the current status of the container, running, paused, ...
	Status string `json:"status"`
	// Bundle is the path on the filesystem to the bundle
	Bundle string `json:"bundle"`
	// Rootfs is a path to a directory containing the container's root filesystem.
	Rootfs string `json:"rootfs"`
	// IP is container veth ip address
	IP string `json:"ip"`
	// Created is the unix timestamp for the creation time of the container in UTC
	Created time.Time `json:"created"`
	// GetAnnotations is the user defined annotations added to the config.
	Annotations map[string]string        `json:"annotations,omitempty"`
	Detail      *libcapsule.StateStorage `json:"detail"`
}

state represents the platform agnostic pieces relating to a running container's status and state

func GetContainerStateVO

func GetContainerStateVO(runtimeRoot string, id string) (*ContainerStateVO, error)

func GetContainerStateVOs

func GetContainerStateVOs(runtimeRoot string, ids []string) ([]*ContainerStateVO, error)

Jump to

Keyboard shortcuts

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