compose

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

README

compose

Package compose deals with parsing Docker Compose files and calling out to docker-compose.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compose

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

Compose represents a call to docker-compose.

func NewCompose

func NewCompose(ctx context.Context, prefix, mode string) (cmp *Compose, cleanup func() error, err error)

NewCompose returns a new Compose and cleanup function given a context, prefix, and mode.

func (Compose) Command

func (c Compose) Command(ctx context.Context, arg ...string) *exec.Cmd

Command makes an *exec.Cmd that calls `docker-compose` with the right arguments and environment.

Command is intended to be a helper function. It is exported mainly so `dkt` can use it.

func (Compose) Down

func (c Compose) Down(ctx context.Context) error

Down calls `docker-compose down`.

func (Compose) GetConfig

func (c Compose) GetConfig(ctx context.Context) ([]byte, error)

GetConfig calls `docker-compose config` and returns the aggregated Compose file.

func (Compose) GetPort

func (c Compose) GetPort(ctx context.Context, service string, port int) (int, error)

GetPort runs `docker-compose port` and returns the public port for a service's port binding.

func (Compose) Pull

func (c Compose) Pull(ctx context.Context, args []string) error

Pull calls `docker-compose pull`.

func (Compose) RunTestfuncOrExecGoTest

func (c Compose) RunTestfuncOrExecGoTest(ctx context.Context, testName string, testFunc func()) error

RunTestfuncOrExecGoTest either calls testFunc directly or runs `docker-compose exec` to re-run `go test` inside the appropriate service (container).

func (Compose) Up

func (c Compose) Up(ctx context.Context, service ...string) error

Up calls `docker-compose up`.

Jump to

Keyboard shortcuts

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