Documentation
¶
Overview ¶
Package config handles loading and validating the stackup.yml configuration file.
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"`
Env EnvConfig `yaml:"env"`
Services map[string]Service `yaml:"services"`
Commands map[string]Command `yaml:"commands"`
Profiles map[string]Profile `yaml:"profiles"`
}
Config represents the top-level stackup.yml structure.
func LoadOrEmpty ¶
LoadOrEmpty returns an empty Config when the file does not exist. Allows projects that haven't added stackup.yml yet to still use the tool.
func (*Config) ProfileServices ¶
ProfileServices returns the service names for a given profile. Returns an error if the profile is not defined.
type EnvVar ¶
type EnvVar struct {
Type string `yaml:"type"`
Required bool `yaml:"required"`
Default string `yaml:"default"`
}
EnvVar describes a single environment variable's constraints.
type HealthCheck ¶
type HealthCheck struct {
Type string `yaml:"type"`
URL string `yaml:"url"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Pattern string `yaml:"pattern"`
Timeout string `yaml:"timeout"`
Interval string `yaml:"interval"`
}
HealthCheck defines how to verify a service is ready.
type HookAction ¶
type HookAction struct {
Name string `yaml:"name"`
Service string `yaml:"service"`
Run string `yaml:"run"`
}
HookAction describes a single hook command to execute inside a container.
type Hooks ¶
type Hooks struct {
AfterStart []HookAction `yaml:"after_start"`
}
Hooks contains lifecycle hook definitions for a service.
type Profile ¶
type Profile struct {
Services []string `yaml:"services"`
}
Profile defines a named subset of services to start.
type Service ¶
type Service struct {
Health *HealthCheck `yaml:"health"`
Hooks *Hooks `yaml:"hooks"`
}
Service defines the health check and lifecycle hooks for a compose service.