dcz

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package dcz provides various utilities for working with Docker Compose.

Index

Constants

This section is empty.

Variables

View Source
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

func NewDockerComposeConfigExtraHosts(extraHostsMaps ...map[string]string) ct.HostsList

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.

Jump to

Keyboard shortcuts

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