dockercompose

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeFile

type ComposeFile struct {
	File string
	Data DockerCompose
}

ComposeFile represents a docker-compose.yml file that can be manipulated

func New added in v0.7.0

func New(file string) ComposeFile

New returns an initialized compose file

func Read added in v0.7.0

func Read(file string) (ComposeFile, error)

Read loads a docker-compose.yml file

func (*ComposeFile) AddService added in v0.7.0

func (composeFile *ComposeFile) AddService(name string) *Service

AddService adds a service to a compose file

func (*ComposeFile) Read added in v0.7.0

func (composeFile *ComposeFile) Read() error

Read reads the data structure from the file note that all variable interpolations are fully rendered

func (*ComposeFile) Write added in v0.7.0

func (composeFile *ComposeFile) Write() error

Write writes the data to a file

func (*ComposeFile) Yaml added in v0.7.0

func (composeFile *ComposeFile) Yaml() ([]byte, error)

Yaml returns the yaml for this compose file

type DockerCompose

type DockerCompose struct {
	Version  string              `yaml:"version"`
	Services map[string]*Service `yaml:"services"`
}

DockerCompose represents a docker-compose.yml file

func UnmarshalComposeYAML added in v0.9.0

func UnmarshalComposeYAML(yamlBytes []byte) (DockerCompose, error)

UnmarshalComposeYAML unmarshals yaml into a DockerCompose struct handles versioning and schema issues

type Port added in v0.7.0

type Port struct {
	Published int64 `yaml:"published"`
	Target    int64 `yaml:"target"`
}

Port represents a port

type Service

type Service struct {
	Image       string            `yaml:"image,omitempty"`
	Ports       []Port            `yaml:"ports,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty"`
	Secrets     map[string]string `yaml:"x-fargate-secrets,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
}

Service represents a docker container

Jump to

Keyboard shortcuts

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