dockerCompose

package
v0.0.0-...-41c7706 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownWithDockerComposeFileCommand

func DownWithDockerComposeFileCommand(filePath string) []string

func UpWithDockerComposeFileCommand

func UpWithDockerComposeFileCommand(filePath string) []string

Types

type DockerYAML

type DockerYAML struct {
	Version  string              `yaml:"version"`
	Networks map[string]*Network `yaml:"networks"`
	Services map[string]*Service `yaml:"services"`
}

func GenerateDockerYAML

func GenerateDockerYAML(version string) *DockerYAML

func (*DockerYAML) AddNetwork

func (that *DockerYAML) AddNetwork(network *Network) error

func (*DockerYAML) AddService

func (that *DockerYAML) AddService(service *Service) error

func (*DockerYAML) ExportToByteArray

func (that *DockerYAML) ExportToByteArray() ([]byte, error)

func (*DockerYAML) ExportToFile

func (that *DockerYAML) ExportToFile(path string, fileName string) error

type Network

type Network struct {
	Name string `yaml:"name"`
}

func GenerateNetwork

func GenerateNetwork(name string) *Network

type Service

type Service struct {
	Image         string   `yaml:"image"`
	Environment   []string `yaml:"environment"`
	Ports         []string `yaml:"ports"`
	Command       string   `yaml:"command"`
	Volumes       []string `yaml:"volumes"`
	ContainerName string   `yaml:"container_name"`
	Networks      []string `yaml:"networks"`
	WorkingDir    string   `yaml:"working_dir"`
	DependsOn     []string `yaml:"depends_on"`
	Tty           bool     `yaml:"tty"`
	StdinOpen     bool     `yaml:"stdin_open"`
}

func GenerateService

func GenerateService() *Service

func (*Service) AddEnvironment

func (that *Service) AddEnvironment(env string) *Service

func (*Service) AddEnvironments

func (that *Service) AddEnvironments(envs []string) *Service

func (*Service) AddNetwork

func (that *Service) AddNetwork(from string, to string) *Service

func (*Service) AddNetworks

func (that *Service) AddNetworks(from []string, to []string) *Service

func (*Service) AddPort

func (that *Service) AddPort(from uint, to uint) *Service

func (*Service) AddPorts

func (that *Service) AddPorts(from []uint, to []uint) *Service

func (*Service) AddVolume

func (that *Service) AddVolume(from string, to string) *Service

func (*Service) AddVolumes

func (that *Service) AddVolumes(from []string, to []string) *Service

func (*Service) SetCommand

func (that *Service) SetCommand(command string) *Service

func (*Service) SetContainerName

func (that *Service) SetContainerName(name string) *Service

func (*Service) SetImage

func (that *Service) SetImage(image string) *Service

Jump to

Keyboard shortcuts

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