dockercompose

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

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

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()

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 (*DockerCompose) UnmarshalYAML added in v0.7.2

func (dc *DockerCompose) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is a custom unmarshaller to support different versions of docker compose

type Port added in v0.7.0

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

Port represents a port long syntax introduced in v3.2

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