containers

package
v0.0.0-...-5f4265e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2015 License: Apache-2.0 Imports: 19 Imported by: 207

Documentation

Overview

Data model for containers running under systemd - identifiers, port references, network links, state, and events. The templates for each systemd unit type are also available here.

Index

Constants

View Source
const IdentifierPrefix = "ctr-"
View Source
const IdentifierSuffixPattern = "[a-zA-Z0-9\\_\\-\\.]{4,24}"

Variables

View Source
var InvalidIdentifier = Identifier("")

Functions

func GetExistingPorts

func GetExistingPorts(id Identifier) (port.PortPairs, error)

Types

type ContainerLink struct {
	Id           Identifier
	NetworkLinks NetworkLinks
}

func (*ContainerLink) Check

func (link *ContainerLink) Check() error
type ContainerLinks struct {
	Links []ContainerLink
}

func (*ContainerLinks) Check

func (link *ContainerLinks) Check() error

func (*ContainerLinks) String

func (link *ContainerLinks) String() string

type Environment

type Environment struct {
	Name  string
	Value string
}

func (*Environment) Check

func (e *Environment) Check() error

func (*Environment) FromString

func (e *Environment) FromString(s string) (bool, error)

type EnvironmentDescription

type EnvironmentDescription struct {
	Variables []Environment
	Source    string
	Id        Identifier // Used on creation only
}

func (*EnvironmentDescription) Check

func (d *EnvironmentDescription) Check() error

func (*EnvironmentDescription) Empty

func (d *EnvironmentDescription) Empty() bool

func (*EnvironmentDescription) Fetch

func (j *EnvironmentDescription) Fetch(upto int64) error

TODO: Return JobErrors that callers can react to

func (*EnvironmentDescription) Map

func (j *EnvironmentDescription) Map() map[string]string

func (*EnvironmentDescription) ReadFrom

func (j *EnvironmentDescription) ReadFrom(r io.Reader) error

func (*EnvironmentDescription) Write

func (j *EnvironmentDescription) Write(appends bool) error

Write the provided enviroment data to an appropriate location

type EnvironmentVariables

type EnvironmentVariables []Environment

func ExtractEnvironmentVariablesFrom

func ExtractEnvironmentVariablesFrom(existing *[]string) (EnvironmentVariables, error)

func ToArray

func ToArray(v map[string]string) EnvironmentVariables

type Identifier

type Identifier string

func NewIdentifier

func NewIdentifier(s string) (Identifier, error)

func NewIdentifierFromUser

func NewIdentifierFromUser(u *user.User) (Identifier, error)

func NewRandomIdentifier

func NewRandomIdentifier(prefix string) (Identifier, error)

func (Identifier) AuthKeysPathFor

func (i Identifier) AuthKeysPathFor() string

func (Identifier) BaseHomePath

func (i Identifier) BaseHomePath() string

func (Identifier) ContainerFor

func (i Identifier) ContainerFor() string

func (Identifier) EnvironmentPathFor

func (i Identifier) EnvironmentPathFor() string

func (Identifier) HomePath

func (i Identifier) HomePath() string

func (Identifier) IdleUnitPathFor

func (i Identifier) IdleUnitPathFor() string

func (Identifier) LoginFor

func (i Identifier) LoginFor() string

func (Identifier) NetworkLinksPathFor

func (i Identifier) NetworkLinksPathFor() string

func (Identifier) PortDescriptionPathFor

func (i Identifier) PortDescriptionPathFor() string

func (Identifier) RunPathFor

func (i Identifier) RunPathFor() string

func (Identifier) SocketUnitNameFor

func (i Identifier) SocketUnitNameFor() string

func (Identifier) SocketUnitPathFor

func (i Identifier) SocketUnitPathFor() string

func (Identifier) UnitIdleFlagNameFor

func (i Identifier) UnitIdleFlagNameFor() string

func (Identifier) UnitNameFor

func (i Identifier) UnitNameFor() string

func (Identifier) UnitNameForJob

func (i Identifier) UnitNameForJob() string

func (Identifier) UnitPathFor

func (i Identifier) UnitPathFor() string

func (Identifier) VersionedUnitPathFor

func (i Identifier) VersionedUnitPathFor(suffix string) string

func (Identifier) VersionedUnitsPathFor

func (i Identifier) VersionedUnitsPathFor() string

type JobIdentifier

type JobIdentifier []byte

func (JobIdentifier) UnitNameFor

func (j JobIdentifier) UnitNameFor() string

An identifier for an individual request

func (JobIdentifier) UnitNameForBuild

func (j JobIdentifier) UnitNameForBuild() string
type NetworkLink struct {
	FromHost string
	FromPort port.Port
	ToPort   port.Port `json:"ToPort,omitempty"`
	ToHost   string    `json:"ToHost,omitempty"`
}

func NewNetworkLinkFromString

func NewNetworkLinkFromString(s string) (*NetworkLink, error)

func (*NetworkLink) Check

func (n *NetworkLink) Check() error

func (*NetworkLink) Complete

func (n *NetworkLink) Complete() bool
type NetworkLinks []NetworkLink

func NewNetworkLinksFromString

func NewNetworkLinksFromString(s string) (NetworkLinks, error)

func (NetworkLinks) Check

func (n NetworkLinks) Check() error

func (NetworkLinks) String

func (n NetworkLinks) String() string

func (NetworkLinks) ToCompact

func (n NetworkLinks) ToCompact() string

func (NetworkLinks) Write

func (n NetworkLinks) Write(path string, appends bool) error

type Volume

type Volume struct {
	Path string
}

func (Volume) String

func (v Volume) String() string

type VolumeConfig

type VolumeConfig struct {
	Volumes      []Volume
	VolumeMounts []VolumeMount
}

func VolumeConfigFromString

func VolumeConfigFromString(s string) (*VolumeConfig, error)

func (VolumeConfig) String

func (vc VolumeConfig) String() string

func (VolumeConfig) ToBindMountSpec

func (vc VolumeConfig) ToBindMountSpec() string

func (VolumeConfig) ToVolumeSpec

func (vc VolumeConfig) ToVolumeSpec() string

type VolumeMount

type VolumeMount struct {
	Path     string
	HostPath string
	ReadOnly bool
}

func NewVolumeMountFromString

func NewVolumeMountFromString(s string) (VolumeMount, error)

func (VolumeMount) String

func (v VolumeMount) String() string

Directories

Path Synopsis
Provides implementation of core gear binary commands.
Provides implementation of core gear binary commands.
Provides http requests and handlers for container jobs.
Provides http requests and handlers for container jobs.
remote
Provides marshalling and remote execution glue for http container job requests.
Provides marshalling and remote execution glue for http container job requests.
Job implementations for core API.
Job implementations for core API.
linux
Provides linux implementations of container jobs.
Provides linux implementations of container jobs.
Provides resource locators for containers, given some Transport.
Provides resource locators for containers, given some Transport.
Systemd concerns for gears: unit files, socket activation, event subscriptions, etc.
Systemd concerns for gears: unit files, socket activation, event subscriptions, etc.
init
The gear 'init' extension - setup environment for containers.
The gear 'init' extension - setup environment for containers.

Jump to

Keyboard shortcuts

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