compose

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(dockerComposeYaml string, opts ...Option) ([]func() error, error)

Build builds all services defined in a docker-compose yaml.

func Supported

func Supported() error

Supported checks if this pkg can run on the current system.

Types

type Compose

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

Compose represents a set of container execution environment (i.e. a set of *dexec.Exec) that is orchestrated as a docker compose project. This can be created using docker compose yaml. Get method provides *dexec.Exec of arbitrary service.

func New

func New(dockerComposeYaml string, opts ...Option) (*Compose, error)

New creates a new Compose of the specified docker-compose yaml data.

func Up

func Up(dockerComposeYaml string, opts ...Option) (*Compose, error)

Up starts all services defined in a docker-compose yaml and returns the execution environment for each service.

func (*Compose) Cleanup

func (c *Compose) Cleanup() (retErr error)

Cleanup teardowns this Compose and cleans up related resources.

func (*Compose) Get

func (c *Compose) Get(serviceName string) (*dexec.Exec, bool)

Get returns *dexec.Exec of an arbitrary service contained in this Compose.

func (*Compose) List

func (c *Compose) List() (l []string)

List lists all service names contained in this Compose.

type Option

type Option func(o *options)

Option is an option for creating compose.

func WithBuildArgs

func WithBuildArgs(buildArgs ...string) Option

WithBuildArgs specifies the build args that will be used during build.

func WithStdio

func WithStdio(stdout, stderr io.Writer) Option

WithStdio specifies stdio which docker-compose build command's stdio will be streamed into.

Jump to

Keyboard shortcuts

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