nspawn

package
v0.6.5-0...-c050ab2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PowerOffTimeout = 30 * time.Second

Variables

View Source
var BootableFiles = []string{
	"/usr/lib/systemd/systemd",
	"/lib/systemd/systemd",
	"/sbin/init",
}

Functions

func IsBootable

func IsBootable(p string) bool

func MachineDead

func MachineDead(status string) bool

func MachineRunning

func MachineRunning(status string) bool

func MachineStatus

func MachineStatus(ctx context.Context, machineId string) string

func MachinectlPowerOff

func MachinectlPowerOff(ctx context.Context, machineId string) error

func MachinectlShell

func MachinectlShell(ctx context.Context, machineId string, runInfo *RunInfo) (int, error)

func MachinectlTerminate

func MachinectlTerminate(ctx context.Context, machineId string) error

func SystemdNspawnBoot

func SystemdNspawnBoot(ctx context.Context, machineId string, dir string, ctnInfo *ContainerInfo) error

func SystemdNspawnRun

func SystemdNspawnRun(ctx context.Context, machineId string, dir string, ctnInfo *ContainerInfo, runInfo *RunInfo) (int, error)

func SystemdRun

func SystemdRun(ctx context.Context, machineId string, runInfo *RunInfo) (int, error)

Types

type ContainerInfo

type ContainerInfo struct {
	Init       bool
	InitArgs   []string
	Properties []string
	Network    *NetworkInfo
}

type ErrCancelled

type ErrCancelled struct {
	// contains filtered or unexported fields
}

func (ErrCancelled) Error

func (e ErrCancelled) Error() string

type NetworkInfo

type NetworkInfo struct {
	//Private     bool
	//IfaceMoveIn []string
	//MacVlan     []string
	//IpVlan      []string
	Zone string
}

TODO: Network Configuration NOTE: NetworkInfo is not used for now.

type RunInfo

type RunInfo struct {
	App    string
	Args   []string
	StdDev *StdDevInfo

	UseSystemdRun bool
}

type StdDevInfo

type StdDevInfo struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

Jump to

Keyboard shortcuts

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