types

package
v0.15.11 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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 {
	Stages   []*Stage   `json:"pipeline"` // pipeline stages
	Networks []*Network `json:"networks"` // network definitions
	Volumes  []*Volume  `json:"volumes"`  // volume definitions
	Secrets  []*Secret  `json:"secrets"`  // secret definitions
}

Config defines the runtime configuration of a pipeline.

type Conn

type Conn struct {
	Name    string   `json:"name"`
	Aliases []string `json:"aliases"`
}

Conn defines a container network connection.

type Engine

type Engine interface {
	Name() string
	IsAvailable() bool
	Load() error

	// Setup the pipeline environment.
	Setup(context.Context, *Config) error

	// Exec start the pipeline step.
	Exec(context.Context, *Step) error

	// Wait for the pipeline step to complete and returns
	// the completion results.
	Wait(context.Context, *Step) (*State, error)

	// Tail the pipeline step logs.
	Tail(context.Context, *Step) (io.ReadCloser, error)

	// Destroy the pipeline environment.
	Destroy(context.Context, *Config) error
}

Engine defines a container orchestration backend and is used to create and manage container resources.

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 Secret

type Secret struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
	Mask  bool   `json:"mask,omitempty"`
}

Secret defines a runtime secret

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 {
	// Container exit code
	ExitCode int `json:"exit_code"`
	// Container exited, true or false
	Exited bool `json:"exited"`
	// Container is oom killed, true or false
	OOMKilled bool `json:"oom_killed"`
}

State defines a 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"`
	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      []string          `json:"volumes,omitempty"`
	Tmpfs        []string          `json:"tmpfs,omitempty"`
	Devices      []string          `json:"devices,omitempty"`
	Networks     []Conn            `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"`
	CPUShares    int64             `json:"cpu_shares,omitempty"`
	CPUSet       string            `json:"cpu_set,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"`
	Sysctls      map[string]string `json:"sysctls,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.

Jump to

Keyboard shortcuts

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