orchestration

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

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

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Name     string
	Config   container.Config
	Network  network.NetworkingConfig
	LogSink  io.WriteCloser
	StatSink io.WriteCloser
	// ID is usually used as a read-only field which
	// is populated when a create step is executed.
	ID string
}

type DockerOrchestrator

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

func NewDockerOrchestrator

func NewDockerOrchestrator() (*DockerOrchestrator, error)

func (*DockerOrchestrator) Run

func (*DockerOrchestrator) WithPosRunStep

func (o *DockerOrchestrator) WithPosRunStep(steps ...RunStep) *DockerOrchestrator

WithPosRunStep sets the post-run steps.

Failures during post-run steps halt the process.

func (*DockerOrchestrator) WithPreRunStep

func (o *DockerOrchestrator) WithPreRunStep(steps ...RunStep) *DockerOrchestrator

WithPreRunStep sets the pre-run steps.

Failures during pre-run steps halt the process and do not execute any other phases of the orchestration.

func (*DockerOrchestrator) WithRunStep

func (o *DockerOrchestrator) WithRunStep(steps ...RunStep) *DockerOrchestrator

WithPreRunStep sets the run steps.

Failures during run steps skips to the post-run part.

type GoBuild

type GoBuild struct {
	PkgPath, Dest string
	BuildCtxSpecs []osutil.BuildCtxSpec
	// ArtifactStore is used to store the context once the build is complete.
	ArtifactStore io.Writer
}

type Image

type Image struct {
	Tag      string
	Rebuild  bool
	BuildCtx io.Reader
}

type Network

type Network struct {
	// Name is the network name used for the network creationg
	Name string
	// ID is usually used as a read-only field which
	// is populated when a create step is executed.
	ID string
}

type RunStep

type RunStep func(context.Context, *client.Client) error

func ContainerCreateStep

func ContainerCreateStep(specs ...*Container) RunStep

func ContainerLogStep

func ContainerLogStep(errLogSink io.Writer, specs ...*Container) RunStep

ContainerLogStep returns a RunStep that copies the container logs to the provided log sinks concurrently in the background.

Only logs of Containers with a non-nil LogSink are copied.

func ContainerRemoveStep

func ContainerRemoveStep(specs ...*Container) RunStep

func ContainerStartStep

func ContainerStartStep(specs ...*Container) RunStep

func ContainerStopStep

func ContainerStopStep(specs ...*Container) RunStep

func ContainerStreamStatStep

func ContainerStreamStatStep(errLogSink io.Writer, specs ...*Container) RunStep

ContainerStreamStatStep returns a RunStep that copies the container stats to the provided metric sinks concurrently in the background.

Only stats of Containers with a non-nil StatSink are copied.

func ContainerWaitStep

func ContainerWaitStep(errLogSink io.Writer, specs ...*Container) RunStep

func EnsureContainerSinkCloseStep

func EnsureContainerSinkCloseStep(specs ...*Container) RunStep

func EnsureImageStep

func EnsureImageStep(specs ...*Image) RunStep

func EnsureNetworkStep

func EnsureNetworkStep(specs ...*Network) RunStep

func GoBuildStep

func GoBuildStep(specs ...*GoBuild) RunStep

Jump to

Keyboard shortcuts

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