dockercompose

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Cmd *exec.Cmd
}

func (Command) RunAndCollect

func (c Command) RunAndCollect() (stdout bytes.Buffer, stderr bytes.Buffer, err error)

func (Command) RunAttached

func (c Command) RunAttached() error

type Config

type Config struct {
	Version  string                   `yaml:"version"`
	Services map[string]ServiceConfig `json:"services"`
	Volumes  map[string]interface{}   `json:"volumes"`
}

type Contents

type Contents struct {
	Version  string                     `yaml:"version"`
	Services map[string]ServiceContents `json:"services"`
	Volumes  map[string]interface{}     `json:"volumes"`
}

func (Contents) ServiceNames

func (c Contents) ServiceNames() []string

func (Contents) VolumeNames

func (c Contents) VolumeNames() []string

type DownOptions

type DownOptions struct {
	Volumes       bool
	RemoveOrphans bool
	Timeout       int
}

type ExecOptions

type ExecOptions struct {
	User                string
	EnableTTYAllocation bool
	CommandAndArgs      []string
}

type File

type File string

func (File) Contents

func (f File) Contents() Contents

func (File) Exists

func (f File) Exists() bool

func (File) ExistsOrExit

func (f File) ExistsOrExit()

func (File) String

func (f File) String() string

type Project

type Project struct {
	Name      string
	Directory string
}

func (Project) Cmd

func (p Project) Cmd(commandAndArgs []string) *exec.Cmd

TODO don't use this externally, use Command?

func (Project) Command

func (p Project) Command(commandAndArgs []string) Command

func (Project) ComposeFiles

func (p Project) ComposeFiles() ([]string, error)

func (Project) Config

func (p Project) Config() Config

Config returns the docker compose config for the project, fully rendered with env vars.

func (Project) ContainerID

func (p Project) ContainerID(service string) (string, error)

func (Project) Down

func (p Project) Down(opts DownOptions) error

func (Project) Exec

func (p Project) Exec(service string, opts ExecOptions) error

func (Project) ExecCommand

func (p Project) ExecCommand(service string, opts ExecOptions) Command

func (Project) File

func (p Project) File(name string) File

func (Project) NetworkName

func (p Project) NetworkName(name string) string

func (Project) Pull

func (p Project) Pull(services []string) error

func (Project) Restart

func (p Project) Restart(services []string) error

func (Project) Rm

func (p Project) Rm(services []string, opts RmOptions) error

func (Project) ServicesWithStatus

func (p Project) ServicesWithStatus(statusFilter string) ([]string, error)

ServicesWithStatus lists services in the docker compose setup that have the given status.

func (Project) Start

func (p Project) Start(services []string) error

func (Project) Stop

func (p Project) Stop(services []string) error

func (Project) TopLevelFilePaths

func (p Project) TopLevelFilePaths() ([]string, error)

func (Project) Up

func (p Project) Up(services []string, opts UpOptions) error

func (Project) VolumesRm

func (p Project) VolumesRm(volumes []string) error

type RmOptions

type RmOptions struct {
	Stop                   bool
	Force                  bool
	RemoveAnonymousVolumes bool
}

type ServiceConfig

type ServiceConfig struct {
	Image string `yaml:"image"`
}

type ServiceContents

type ServiceContents struct {
	Image       string   `yaml:"image"`
	Entrypoint  string   `yaml:"entrypoint"`
	Volumes     []string `yaml:"volumes"`
	Environment []string `yaml:"environment"`
	DependsOn   []string `yaml:"depends_on"`
	DNS         []string `yaml:"dns"`
	Networks    []string `yaml:"networks"`
}

type UpOptions

type UpOptions struct {
	Detached      bool
	ForceRecreate bool
}

Jump to

Keyboard shortcuts

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