supervisor

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: Apache-2.0 Imports: 24 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 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
}

func New

func New(stateDir, eventLogDir string, f factory.Factory) (*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) (*Container, *Process, error)

func (*Supervisor) Signal

func (sv *Supervisor) Signal(container, processId string, sig int) 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

Jump to

Keyboard shortcuts

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