Help us shape the future of Go! Take the 2026 Go Developer Survey

supervisor

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventExit           = "exit"
	EventContainerStart = "start-container"
	EventProcessStart   = "start-process"
)

Variables

This section is empty.

Functions

func GetBridgeFromIndex

func GetBridgeFromIndex(idx int) (string, error)

Types

type Container

type Container struct {
	Id         string
	BundlePath string
	Spec       *specs.Spec
	Processes  map[string]*Process
	// contains filtered or unexported fields
}

type Event

type Event struct {
	ID        string    `json:"id"`
	Type      string    `json:"type"`
	Timestamp time.Time `json:"timestamp"`
	PID       string    `json:"pid,omitempty"`
	Status    int       `json:"status,omitempty"`
}

type HyperPod

type HyperPod struct {
	Containers map[string]*Container
	Processes  map[string]*Process
	// contains filtered or unexported fields
}

type InterfaceInfo

type InterfaceInfo struct {
	Index     int
	PeerIndex int
	Ip        string
}

type NetlinkUpdate added in v0.6.2

type NetlinkUpdate struct {
	// AddrUpdate is used to pass information back from AddrSubscribe()
	Addr netlink.AddrUpdate
	// RouteUpdate is used to pass information back from RouteSubscribe()
	Route netlink.RouteUpdate
	// Veth is used to pass information back from LinkSubscribe().
	// We only support veth link at present.
	Veth *netlink.Veth

	// UpdateType indicates which part of the netlink information has been changed.
	UpdateType NetlinkUpdateType
}

NetlinkUpdate tracks the change of network namespace.

type NetlinkUpdateType added in v0.6.2

type NetlinkUpdateType string
const (
	UpdateTypeLink  NetlinkUpdateType = "link"
	UpdateTypeAddr  NetlinkUpdateType = "addr"
	UpdateTypeRoute NetlinkUpdateType = "route"
)

type Process

type Process struct {
	Id     string
	Stdin  string
	Stdout string
	Stderr string
	Spec   *specs.Process
	ProcId int
	// contains filtered or unexported fields
}

type Supervisor

type Supervisor struct {
	StateDir string
	Factory  factory.Factory

	Events SvEvents

	sync.RWMutex // Protects Supervisor.Containers, HyperPod.Containers, HyperPod.Processes, Container.Processes
	Containers   map[string]*Container
	// contains filtered or unexported fields
}

func New

func New(stateDir, eventLogDir string, f factory.Factory, defaultCpus int, defaultMemory int) (*Supervisor, error)

func (*Supervisor) AddProcess

func (sv *Supervisor) AddProcess(container, processId, stdin, stdout, stderr string, spec *specs.Process) (*Process, error)

func (*Supervisor) CloseStdin

func (sv *Supervisor) CloseStdin(container, processId string) error

func (*Supervisor) CreateContainer

func (sv *Supervisor) CreateContainer(container, bundlePath, stdin, stdout, stderr string, spec *specs.Spec) (c *Container, err error)

func (*Supervisor) Signal

func (sv *Supervisor) Signal(container, processId string, sig int) error

func (*Supervisor) StartContainer added in v0.8.1

func (sv *Supervisor) StartContainer(container string, spec *specs.Spec) (c *Container, p *Process, err error)

func (*Supervisor) TtyResize

func (sv *Supervisor) TtyResize(container, processId string, width, height int) error

type SvEvents

type SvEvents struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*SvEvents) Events

func (se *SvEvents) Events(from time.Time) chan Event

Events returns an event channel that external consumers can use to receive updates on container events

func (*SvEvents) Unsubscribe

func (se *SvEvents) Unsubscribe(sub chan Event)

Unsubscribe removes the provided channel from receiving any more events

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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