Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
}
Auth defines registry authentication credentials.
type Config ¶
type Config struct {
Version int64 `json:"version"`
Stages []*Stage `json:"pipeline"` // pipeline stages
Networks []*Network `json:"networks"` // network definitions
Volumes []*Volume `json:"volumes"` // volume definitions
}
Config defines the runtime configuration.
func ParseString ¶
ParseString parses the pipeline config from a string.
type DeviceMapping ¶
DeviceMapping describes a device mapping.
type Engine ¶
type Engine interface {
// Setup the pipeline environment.
Setup(*Config) error
// Create creates the pipeline state.
Create(*Step) error
// Start the pipeline step.
Start(*Step) error
// Wait for the pipeline step to complete and returns the completion results.
Wait(*Step) (*State, error)
// Tail the pipeline step logs.
Tail(*Step) (io.ReadCloser, error)
// Upload uploads the file or data to the environment.
Upload(*Step, string, io.Reader) error
// Download downloads the file or data from the environment.
Download(*Step, string) (io.ReadCloser, *FileInfo, error)
// Destroy the pipeline environment.
Destroy(*Config) error
}
Engine defines a runtime engine for pipeline execution.
type File ¶
type File struct {
Path string `json:"path,omitempty"` // File path
Mime string `json:"mime,omitempty"` // File mime type
}
File defines a file exported from the container.
type FileInfo ¶
type FileInfo struct {
Name string // File path
Path string // File path
Size int64 // File size
Time int64 // File time
Mime string // File mime type
IsDir bool // File is directory
}
FileInfo defines a file stat
type Network ¶
type Network struct {
Name string `json:"name,omitempty"`
Driver string `json:"driver,omitempty"`
DriverOpts map[string]string `json:"driver_opts,omitempty"`
}
Network defines a container network.
type NetworkMapping ¶
NetworkMapping defines a container network mapping.
type Secret ¶
type Secret struct {
Name string `json:"name,omitempty"` // Secret name
Value string `json:"value,omitempty"` // Secret value
Mount string `json:"mount,omitempty"` // Secrets are mounted as a file
Mask bool `json:"mask,omitempty"` // Secrets are masked in output
}
Secret defines a runtime secret
type Snapshot ¶
type Snapshot struct {
Data []byte `json:"data,omitempty"`
Source string `json:"source,omitempty"`
Target string `json:"target,omitempty"`
}
Snapshot defines a container volume snapshot
type Stage ¶
type Stage struct {
Name string `json:"name,omitempty"`
Alias string `json:"alias,omitempty"`
Steps []*Step `json:"steps,omitempty"`
}
Stage denotes a collection of one or more steps.
type State ¶
type State struct {
ExitCode int // Container exit code
Exited bool // Container exited
OOMKilled bool // Container is oom killed
}
State represents the container state.
type Step ¶
type Step struct {
Name string `json:"name"`
Alias string `json:"alias,omitempty"`
Image string `json:"image,omitempty"`
Pull bool `json:"pull,omitempty"`
Detached bool `json:"detach,omitempty"`
Privileged bool `json:"privileged,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
Secrets []*Secret `json:"secrets,omitempty"`
Environment map[string]string `json:"environment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Entrypoint []string `json:"entrypoint,omitempty"`
Command []string `json:"command,omitempty"`
ExtraHosts []string `json:"extra_hosts,omitempty"`
Volumes []*VolumeMapping `json:"volumes,omitempty"`
Tmpfs []string `json:"tmpfs,omitempty"`
Devices []*DeviceMapping `json:"devices,omitempty"`
Networks []*NetworkMapping `json:"networks,omitempty"`
DNS []string `json:"dns,omitempty"`
DNSSearch []string `json:"dns_search,omitempty"`
MemSwapLimit int64 `json:"memswap_limit,omitempty"`
MemLimit int64 `json:"mem_limit,omitempty"`
ShmSize int64 `json:"shm_size,omitempty"`
CPUQuota int64 `json:"cpu_quota,omitempty"`
CPUSet string `json:"cpu_set,omitempty"`
ErrIgnore bool `json:"err_ignore,omitempty"`
OnFailure bool `json:"on_failure,omitempty"`
OnSuccess bool `json:"on_success,omitempty"`
AuthConfig Auth `json:"auth_config,omitempty"`
NetworkMode string `json:"network_mode,omitempty"`
IpcMode string `json:"ipc_mode,omitempty"`
Exports []*File `json:"exports,omitempty"`
Backup []*Snapshot `json:"backup,omitempty"`
Restore []*Snapshot `json:"restore,omitempty"`
}
Step defines a container process.
type Volume ¶
type Volume struct {
Name string `json:"name,omitempty"`
Driver string `json:"driver,omitempty"`
DriverOpts map[string]string `json:"driver_opts,omitempty"`
}
Volume defines a container volume.
type VolumeMapping ¶
type VolumeMapping struct {
Name string `json:"name"`
Source string `json:"source"`
Target string `json:"target"`
}
VolumeMapping describes a volume mapping.