Documentation
¶
Overview ¶
Package dcz provides various utilities for working with Docker Compose.
Index ¶
- Variables
- func NewDockerComposeConfigDeploy(memoryLimitMB int64, replicas uint64) *ct.DeployConfig
- func NewDockerComposeConfigExtraHosts(extraHostsMaps ...map[string]string) ct.HostsList
- func NewDockerComposeConfigHealthCheckShell(format string, a ...any) *ct.HealthCheckConfig
- func RestoreDefaultRuntimeGOOS()
- type DockerCompose
- func (d *DockerCompose) GetCommand() *shellz.Command
- func (d *DockerCompose) GetConfig() *ct.Config
- func (d *DockerCompose) GetDownCommand() *shellz.Command
- func (d *DockerCompose) GetMarshaledConfig() []byte
- func (d *DockerCompose) GetPSCommand() *shellz.Command
- func (d *DockerCompose) GetProfiles() []string
- func (d *DockerCompose) GetProjectName() string
- func (d *DockerCompose) GetUpCommand() *shellz.Command
- func (d *DockerCompose) WithProfiles(profiles ...string) *DockerCompose
- func (d *DockerCompose) WithProjectName(projectName string) *DockerCompose
Constants ¶
This section is empty.
Variables ¶
var (
// DefaultRuntimeGOOS allows to inject different values of [runtime.GOOS] for tests.
DefaultRuntimeGOOS = defaultRuntimeGOOS
)
Functions ¶
func NewDockerComposeConfigDeploy ¶
func NewDockerComposeConfigDeploy(memoryLimitMB int64, replicas uint64) *ct.DeployConfig
NewDockerComposeConfigDeploy is a Docker Compose config helper.
func NewDockerComposeConfigExtraHosts ¶
NewDockerComposeConfigExtraHosts is a Docker Compose config helper.
func NewDockerComposeConfigHealthCheckShell ¶
func NewDockerComposeConfigHealthCheckShell(format string, a ...any) *ct.HealthCheckConfig
NewDockerComposeConfigHealthCheckShell is a Docker Compose config helper.
func RestoreDefaultRuntimeGOOS ¶
func RestoreDefaultRuntimeGOOS()
RestoreDefaultRuntimeGOOS restores the default value of DefaultRuntimeGOOS.
Types ¶
type DockerCompose ¶
type DockerCompose struct {
// contains filtered or unexported fields
}
DockerCompose helps operate a Docker Compose config.
func NewDockerCompose ¶
func NewDockerCompose(cfg *ct.Config) *DockerCompose
NewDockerCompose initializes a new *DockerCompose.
func (*DockerCompose) GetCommand ¶
func (d *DockerCompose) GetCommand() *shellz.Command
GetCommand returns a pre-configured "docker compose" *shellz.Command.
func (*DockerCompose) GetConfig ¶
func (d *DockerCompose) GetConfig() *ct.Config
GetConfig returns the Docker Compose config.
func (*DockerCompose) GetDownCommand ¶
func (d *DockerCompose) GetDownCommand() *shellz.Command
GetDownCommand returns a pre-configured "docker compose down" *shellz.Command.
func (*DockerCompose) GetMarshaledConfig ¶
func (d *DockerCompose) GetMarshaledConfig() []byte
GetMarshaledConfig returns the Docker Compose config marshaled to YAML.
func (*DockerCompose) GetPSCommand ¶
func (d *DockerCompose) GetPSCommand() *shellz.Command
GetPSCommand returns a pre-configured "docker compose ps" *shellz.Command.
func (*DockerCompose) GetProfiles ¶
func (d *DockerCompose) GetProfiles() []string
GetProfiles returns the Docker Compose profiles if set.
func (*DockerCompose) GetProjectName ¶
func (d *DockerCompose) GetProjectName() string
GetProjectName returns the Docker Compose project name if set.
func (*DockerCompose) GetUpCommand ¶
func (d *DockerCompose) GetUpCommand() *shellz.Command
GetUpCommand returns a pre-configured "docker compose up" *shellz.Command.
func (*DockerCompose) WithProfiles ¶
func (d *DockerCompose) WithProfiles(profiles ...string) *DockerCompose
WithProfiles returns a clone of the *DockerCompose with the given profiles set.
func (*DockerCompose) WithProjectName ¶
func (d *DockerCompose) WithProjectName(projectName string) *DockerCompose
WithProjectName returns a clone of the *DockerCompose with the given project name set.