process

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandSystem = "core.system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerCommandArguments

type ContainerCommandArguments struct {
	Name        string            `json:"name"`
	Dir         string            `json:"dir"`
	Args        []string          `json:"args"`
	Env         map[string]string `json:"env"`
	HostNetwork bool              `json:"host_network"`
	Chroot      string            `json:"chroot"`
}

type GetPID

type GetPID func() (int, error)

type PIDTable

type PIDTable interface {
	//Register atomic registration of PID. MUST grantee that that no wait4 will happen
	//on any of the child process until the register operation is done.
	Register(g GetPID) error
	WaitPID(pid int) syscall.WaitStatus
}

type Process

type Process interface {
	Command() *core.Command
	Run() (<-chan *stream.Message, error)
}

Process interface

func NewContainerProcess

func NewContainerProcess(table PIDTable, cmd *core.Command) Process

func NewSystemProcess

func NewSystemProcess(table PIDTable, cmd *core.Command) Process

type ProcessFactory

type ProcessFactory func(PIDTable, *core.Command) Process

func NewExtensionProcessFactory

func NewExtensionProcessFactory(exe string, dir string, args []string, env map[string]string) ProcessFactory

func NewInternalProcessFactory

func NewInternalProcessFactory(runnable Runnable) ProcessFactory

internalProcessFactory factory to build Runnable processes

type ProcessStats

type ProcessStats struct {
	CPU   float64 `json:"cpu"`
	RSS   uint64  `json:"rss"`
	VMS   uint64  `json:"vms"`
	Swap  uint64  `json:"swap"`
	Debug string  `json:"debug,ommitempty"`
}

ProcessStats holds process cpu and memory usage

type Runnable

type Runnable func(*core.Command) (interface{}, error)

Runnable represents a runnable built in function that can be managed by the process manager.

type Signaler added in v1.0.0

type Signaler interface {
	Signal(sig syscall.Signal) error
}

type Stater added in v0.11.0

type Stater interface {
	Stats() *ProcessStats
}

type SystemCommandArguments

type SystemCommandArguments struct {
	Name  string            `json:"name"`
	Dir   string            `json:"dir"`
	Args  []string          `json:"args"`
	Env   map[string]string `json:"env"`
	StdIn string            `json:"stdin"`

	//Only internal commands can sent the NoOutput flag.
	NoOutput bool `json:"-"`
}

Jump to

Keyboard shortcuts

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