Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Version string `yaml:"version"`
Services map[string]Service `yaml:"services"`
}
Config represents the top-level docker-compose.yml structure.
type DependsOn ¶
type DependsOn map[string]DependsOnCondition
DependsOn supports both forms of the depends_on key:
depends_on: [db, redis] ← list form
depends_on:
db:
condition: service_healthy ← map form
type DependsOnCondition ¶
type DependsOnCondition struct {
Condition string `yaml:"condition"`
}
DependsOnCondition holds the optional condition for a single dependency.
type Healthcheck ¶
type Healthcheck struct {
Test HealthcheckTest `yaml:"test"`
Interval string `yaml:"interval"`
Timeout string `yaml:"timeout"`
StartPeriod string `yaml:"start_period"`
StartInterval string `yaml:"start_interval"`
Retries int `yaml:"retries"`
Disable bool `yaml:"disable"`
}
Healthcheck mirrors the docker-compose healthcheck block.
type HealthcheckTest ¶ added in v0.4.0
type HealthcheckTest []string
HealthcheckTest supports both string and list forms of healthcheck.test:
test: curl -f http://localhost/ → ["CMD-SHELL", "..."] test: ["CMD", "curl", "-f", "http://…"]
func (*HealthcheckTest) UnmarshalYAML ¶ added in v0.4.0
func (t *HealthcheckTest) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML handles scalar (CMD-SHELL) and sequence forms of test.
type Ports ¶ added in v0.5.0
type Ports []string
Ports supports short-form strings and long-form maps from `docker compose config`:
ports: ["8080:80"]
ports: [{target: 80, published: "8080", protocol: tcp}]
type Service ¶
type Service struct {
Image string `yaml:"image"`
Build interface{} `yaml:"build"`
DependsOn DependsOn `yaml:"depends_on"`
Healthcheck *Healthcheck `yaml:"healthcheck"`
Restart string `yaml:"restart"`
Ports Ports `yaml:"ports"`
Environment map[string]string `yaml:"environment"`
}
Service represents a single service definition.
Click to show internal directories.
Click to hide internal directories.