process

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2017 License: Apache-2.0 Imports: 9 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"`
	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)
	Kill()
}

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 {
	Cmd   *core.Command `json:"cmd,omitempty"`
	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 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 []byte            `json:"stdin"`
}

Jump to

Keyboard shortcuts

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