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 (*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.1
func (dc *DockerCompose) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is a custom unmarshaller to support different versions of docker compose
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
Click to show internal directories.
Click to hide internal directories.