compose

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDockerComposeVersionMismatch = func(s string) error {
	return fmt.Errorf("docker-compose version is too old: %s", s)
}

Functions

func Completer

func Completer() func(cmd *cobra.Command, args []string, toComplete string) (
	[]string, cobra.ShellCompDirective,
)

Completer returns a cobra Command completer function for docker-compose.

Types

type Client

type Client interface {
	Check() error
	Version() (*version.Version, error)
	IsMinimumVersionInstalled() bool
	RunCommand(args []string, opts ...shell.Opt) (output []byte, err error)
	RunWithConfig(args []string, details ConfigDetails, opts ...shell.Opt) (string, error)
}

type ConfigDetails

type ConfigDetails struct {
	Version     string
	WorkingDir  string
	ConfigFiles []ConfigFile
	Environment map[string]string
}

ConfigDetails are the details about a group of ConfigFiles

type ConfigFile

type ConfigFile struct {
	Filename string
	Config   map[string]any
}

ConfigFile is a filename and the contents of the file as a Dict

type DockerComposeClient

type DockerComposeClient struct {
	shell.Shell
	// contains filtered or unexported fields
}

func NewDockerComposeClient

func NewDockerComposeClient(s shell.Shell, tmpFiles *list.List) *DockerComposeClient

func NewMockClient

func NewMockClient(command string, output []byte, err error) *DockerComposeClient

func (*DockerComposeClient) Check

func (c *DockerComposeClient) Check() error

func (*DockerComposeClient) IsMinimumVersionInstalled

func (c *DockerComposeClient) IsMinimumVersionInstalled() bool

func (*DockerComposeClient) RunCommand

func (c *DockerComposeClient) RunCommand(args []string, opts ...shell.Opt) (output []byte, err error)

RunCommand runs the passed parameters with docker-compose and returns the output.

func (*DockerComposeClient) RunWithConfig

func (c *DockerComposeClient) RunWithConfig(args []string, details ConfigDetails, opts ...shell.Opt) (string, error)

RunWithConfig calls docker-compose with the converted configuration settings (from templates).

func (*DockerComposeClient) Version

func (c *DockerComposeClient) Version() (*version.Version, error)

type DockerComposeOpt

type DockerComposeOpt func(*DockerComposeClient)

Jump to

Keyboard shortcuts

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