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 Services []*Service Networks Networks Volumes NamedVolumes }
Config represents docker-compose file as a struct
type Environment ¶
Environment represents 'environment' directive in docker-compose file
func (Environment) Render ¶
func (e Environment) Render() string
Render formats Environment as YAML string
type NamedVolume ¶
type NamedVolume struct { Name string Driver VolumeDriver }
NamedVolume represents top-level volume in docker-compose file
func (*NamedVolume) Render ¶
func (v *NamedVolume) Render() string
Render formats NamedVolume as YAML string
func (*NamedVolume) ToServiceVolume ¶
func (v *NamedVolume) ToServiceVolume() *ServiceVolume
ToServiceVolume transforms NamedVolume to ServiceVolume
type NamedVolumes ¶
type NamedVolumes []*NamedVolume
NamedVolumes represents top-level 'volumes' directive in docker-compose file
func (NamedVolumes) IsEmpty ¶
func (v NamedVolumes) IsEmpty() bool
IsEmpty checks if NamedVolumes has zero volumes
func (NamedVolumes) Render ¶
func (v NamedVolumes) Render() string
Render formats NamedVolumes as YAML string
func (NamedVolumes) ToServiceVolumes ¶
func (v NamedVolumes) ToServiceVolumes() ServiceVolumes
ToServiceVolumes transforms NamedVolumes to ServiceVolumes
type NestingLevel ¶
type NestingLevel int
NestingLevel represents how deep string to which it is applied should be nested
func (NestingLevel) ApplyTo ¶
func (n NestingLevel) ApplyTo(str string) string
ApplyTo adds spaces (based on the NestingLevel) to the left of the string
type Network ¶
type Network struct { Name string Driver NetworkDriver }
Network is a top-level network in docker-compose file
type NetworkDriver ¶
type NetworkDriver string
NetworkDriver is one of the network drivers supported by docker
const ( NetworkDriverBridge NetworkDriver = "bridge" NetworkDriverHost NetworkDriver = "host" NetworkDriverOverlay NetworkDriver = "overlay" NetworkDriverMacvlan NetworkDriver = "macvlan" NetworkDriverNone NetworkDriver = "none" )
All supported network drivers
type Networks ¶
type Networks []*Network
Networks is a top-level networks directive
func (Networks) ToServiceNetworks ¶
func (n Networks) ToServiceNetworks() ServiceNetworks
ToServiceNetworks transforms top-level Networks to service-level ServiceNetworks
type PortsMapping ¶
PortsMapping represents a single mapping of host port to container port
func (*PortsMapping) Render ¶
func (m *PortsMapping) Render() string
Render formats PortsMapping as YAML string
type RestartPolicy ¶
type RestartPolicy string
RestartPolicy is one of the restart policies supported by docker
const ( RestartPolicyNo RestartPolicy = "no" RestartPolicyAlways RestartPolicy = "always" RestartPolicyOnFailure RestartPolicy = "on-failure" RestartPolicyUnlessStopped RestartPolicy = "unless-stopped" )
All supported restart policies
func (RestartPolicy) Render ¶
func (r RestartPolicy) Render() string
Render formats RestartPolicy as YAML string
type Service ¶
type Service struct { Name string Build *Build Image *Image ContainerName string WorkingDir string Restart RestartPolicy Ports Ports Environment Environment Networks ServiceNetworks Volumes ServiceVolumes }
Service represents a single service inside docker-compose services directive
type ServiceNetworks ¶
type ServiceNetworks []*Network
ServiceNetworks is service-level networks
func (ServiceNetworks) Render ¶
func (n ServiceNetworks) Render() string
Render formats ServiceNetworks as YAML string
type ServiceVolume ¶
ServiceVolume represents service-level volume mapping in docker-compose file
func (*ServiceVolume) String ¶
func (v *ServiceVolume) String() string
String formats ServiceVolume as a mapping
type ServiceVolumes ¶
type ServiceVolumes []*ServiceVolume
ServiceVolumes represents service-level volumes directive
func (ServiceVolumes) Render ¶
func (v ServiceVolumes) Render() string
Render formats ServiceVolumes as YAML string
type VolumeDriver ¶
type VolumeDriver string
VolumeDriver is one of the volume drivers supported by docker
const (
VolumeDriverLocal VolumeDriver = "local"
)
All supported volume drivers