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
- Variables
- func GetExistingPorts(id Identifier) (port.PortPairs, error)
- type ContainerLink
- type ContainerLinks
- type Environment
- type EnvironmentDescription
- func (d *EnvironmentDescription) Check() error
- func (d *EnvironmentDescription) Empty() bool
- func (j *EnvironmentDescription) Fetch(upto int64) error
- func (j *EnvironmentDescription) Map() map[string]string
- func (j *EnvironmentDescription) ReadFrom(r io.Reader) error
- func (j *EnvironmentDescription) Write(appends bool) error
- type EnvironmentVariables
- type Identifier
- func (i Identifier) AuthKeysPathFor() string
- func (i Identifier) BaseHomePath() string
- func (i Identifier) ContainerFor() string
- func (i Identifier) EnvironmentPathFor() string
- func (i Identifier) HomePath() string
- func (i Identifier) IdleUnitPathFor() string
- func (i Identifier) LoginFor() string
- func (i Identifier) NetworkLinksPathFor() string
- func (i Identifier) PortDescriptionPathFor() string
- func (i Identifier) RunPathFor() string
- func (i Identifier) SocketUnitNameFor() string
- func (i Identifier) SocketUnitPathFor() string
- func (i Identifier) UnitIdleFlagNameFor() string
- func (i Identifier) UnitNameFor() string
- func (i Identifier) UnitNameForJob() string
- func (i Identifier) UnitPathFor() string
- func (i Identifier) VersionedUnitPathFor(suffix string) string
- func (i Identifier) VersionedUnitsPathFor() string
- type JobIdentifier
- type NetworkLink
- type NetworkLinks
- type Volume
- type VolumeConfig
- type VolumeMount
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 ¶
type ContainerLink struct { Id Identifier NetworkLinks NetworkLinks }
func (*ContainerLink) Check ¶
func (link *ContainerLink) Check() error
type ContainerLinks ¶
type ContainerLinks struct {
Links []ContainerLink
}
func (*ContainerLinks) Check ¶
func (link *ContainerLinks) Check() error
func (*ContainerLinks) String ¶
func (link *ContainerLinks) String() string
type Environment ¶
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 ¶
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 ¶
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
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 ¶
func NewVolumeMountFromString ¶
func NewVolumeMountFromString(s string) (VolumeMount, error)
func (VolumeMount) String ¶
func (v VolumeMount) String() string
Source Files ¶
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. |
Click to show internal directories.
Click to hide internal directories.