linux_backend

package
v0.0.0-...-33bca21 Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHooks

func RegisterHooks(hs hook.HookSet, runner Runner, config process.Env, containerInitializer ContainerInitializer, configurer network.Configurer)

Types

type Config

type Config struct {
	Network json.RawMessage `json:"network"`
}

type Container

type Container interface {
	ID() string
	HasProperties(garden.Properties) bool
	GraceTime() time.Duration

	Start() error

	Snapshot(io.Writer) error
	Cleanup()

	garden.Container
}

type ContainerInitializer

type ContainerInitializer interface {
	MountProc() error
	MountTmp() error
}

func NewContainerInitializer

func NewContainerInitializer() ContainerInitializer

type ContainerPool

type ContainerPool interface {
	Setup() error
	Create(garden.ContainerSpec) (Container, error)
	Restore(io.Reader) (Container, error)
	Destroy(Container) error
	Prune(keep map[string]bool) error
	MaxContainers() int
}

type ContainerRepository

type ContainerRepository interface {
	All() []Container
	Add(Container)
	FindByHandle(string) (Container, error)
	Query(filter func(Container) bool) []Container
	Delete(Container)
}

type FailedToSnapshotError

type FailedToSnapshotError struct {
	OriginalError error
}

func (FailedToSnapshotError) Error

func (e FailedToSnapshotError) Error() string

type HandleExistsError

type HandleExistsError struct {
	Handle string
}

func (HandleExistsError) Error

func (e HandleExistsError) Error() string

type LinuxBackend

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

func New

func New(
	logger lager.Logger,
	containerPool ContainerPool,
	containerRepo ContainerRepository,
	systemInfo system_info.Provider,
	snapshotsPath string,
) *LinuxBackend

func (*LinuxBackend) BulkInfo

func (b *LinuxBackend) BulkInfo(handles []string) (map[string]garden.ContainerInfoEntry, error)

func (*LinuxBackend) BulkMetrics

func (b *LinuxBackend) BulkMetrics(handles []string) (map[string]garden.ContainerMetricsEntry, error)

func (*LinuxBackend) Capacity

func (b *LinuxBackend) Capacity() (garden.Capacity, error)

func (*LinuxBackend) Containers

func (b *LinuxBackend) Containers(props garden.Properties) ([]garden.Container, error)

func (*LinuxBackend) Create

func (*LinuxBackend) Destroy

func (b *LinuxBackend) Destroy(handle string) error

func (*LinuxBackend) GraceTime

func (b *LinuxBackend) GraceTime(container garden.Container) time.Duration

func (*LinuxBackend) Lookup

func (b *LinuxBackend) Lookup(handle string) (garden.Container, error)

func (*LinuxBackend) Ping

func (b *LinuxBackend) Ping() error

func (*LinuxBackend) Setup

func (b *LinuxBackend) Setup() error

func (*LinuxBackend) Start

func (b *LinuxBackend) Start() error

func (*LinuxBackend) Stop

func (b *LinuxBackend) Stop()

type NamespacedSignaller

type NamespacedSignaller struct {
	Runner        command_runner.CommandRunner
	ContainerPath string
	PidFilePath   string
}

Kills a process by invoking ./bin/wsh in the given container path using a PID read from the given pidFile

func (*NamespacedSignaller) Signal

func (n *NamespacedSignaller) Signal(signal os.Signal) error

type Network

type Network struct {
	Subnet *net.IPNet
	IP     net.IP
}

func (*Network) MarshalJSON

func (n *Network) MarshalJSON() ([]byte, error)

func (*Network) UnmarshalJSON

func (n *Network) UnmarshalJSON(b []byte) error

type Resources

type Resources struct {
	UserUID    int
	RootUID    int
	Network    *Network
	Bridge     string
	Ports      []uint32
	ExternalIP net.IP
	// contains filtered or unexported fields
}

func NewResources

func NewResources(
	useruid int,
	rootuid int,
	network *Network,
	bridge string,
	ports []uint32,
	externalIP net.IP,
) *Resources

func (*Resources) AddPort

func (r *Resources) AddPort(port uint32)

type Runner

type Runner interface {
	Run(*exec.Cmd) error
}

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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