container

package
v0.0.0-...-976313a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Running = "RUNNING"
	Stop    = "STOPPED"
	Exit    = "EXITED"
)
View Source
const (
	RootURL       = "/root/"
	WriteLayerURL = "/var/lib/mydocker/%s/writeLayer"
	MntURL        = "/run/mydocker/%s/mnt"
)

Variables

View Source
var (
	DefaultInfoLocation = "/var/lib/mydocker/infos"
	ConfigName          = "config.json"
)

Functions

func CleanUpWorkspace

func CleanUpWorkspace(containerID string) error

func CreateMountPoint

func CreateMountPoint(rootURL, writeLayerURL, mntURL, containerID string)

func CreateMountVolumePoint

func CreateMountVolumePoint(mntURL string, volumeURLs []string)

func CreateReadOnlyLayer

func CreateReadOnlyLayer(rootURL string)

func CreateWriteLayer

func CreateWriteLayer(writeLayerURL string)

func DeleteContainerInfo

func DeleteContainerInfo(containerID string)

func DeleteMountPoint

func DeleteMountPoint(mntURL string)

func DeleteWorkSpace

func DeleteWorkSpace(writeLayerURL, mntURL string, volumeURLs []string)

DeleteWorkSpace delete container workspace

func DeleteWriteLayer

func DeleteWriteLayer(writeLayerURL string)

func GenerateUUID

func GenerateUUID() string

GenerateUUID container UUID

func GetContainerPidByID

func GetContainerPidByID(containerId string) (string, error)

func GetContainerPidByIdentification

func GetContainerPidByIdentification(containerNameOrID string) (string, error)

func GetContainerPidByName

func GetContainerPidByName(containerName string) (string, error)

func ListContainer

func ListContainer(all bool)

func NewWorkSpace

func NewWorkSpace(containerID string, volumeURLs []string)

NewWorkSpace create container workspace

func RecordContainerInfo

func RecordContainerInfo(containerPID int, containerID, containerName string, cmdArgs []string) (string, error)

RecordContainerInfo record container info

func UnmountVolume

func UnmountVolume(volumeMntURL string)

Types

type Info

type Info struct {
	Pid       string   `json:"pid"`
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Command   string   `json:"command"`
	CreatedAt string   `json:"created_at"`
	Status    string   `json:"status"`
	Rm        bool     `json:"remove"`
	Tty       bool     `json:"tty"`
	Volumes   []string `json:"volumes"`
	Resource  string   `json:"resource"`
	Envs      []string `json:"envs"`
}

container info

func GetContainerInfoByIdentification

func GetContainerInfoByIdentification(containerNameOrID string) (*Info, error)

func GetContainerInfoByName

func GetContainerInfoByName(containerName string) (*Info, error)

func (*Info) Remove

func (containerInfo *Info) Remove() error

func (*Info) Save

func (containerInfo *Info) Save() error

func (*Info) Stop

func (containerInfo *Info) Stop() error

Jump to

Keyboard shortcuts

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