Documentation
¶
Overview ¶
Package compose implements an AST, parser, validator, and interpolator for <https://github.com/compose-spec/compose-spec>.
The AST preserves some formatting information from the source Yaml. This enables extracting subdocuments in a way that perserves source formatting, and in particular maintains the stable ordering of map entries.
Parsing is implemented in terms of yaml unmarshaling and performs partial evaluation of interpolation. All scalar leaf nodes contain a String structure which maintains the original Expression string and an interpolated Value string. Other scalar types (numbers and booleans), as well as composite types, will embed a String to facitate delaying interpolation until an environment is available.
Index ¶
- Constants
- Variables
- func FormatPort(num uint16, protocol string) string
- func ParsePortRange(numbers string) (min uint16, max uint16, err error)
- type BindOptions
- type BlkioConfig
- type Bool
- type Build
- type BuildLongForm
- type ByteUnit
- type Bytes
- type Command
- type Config
- type DeviceMapping
- type Dictionary
- func (dict *Dictionary) Interpolate(env Environment) error
- func (dict Dictionary) Map() map[string]string
- func (dict Dictionary) MapOfPtr() map[string]*string
- func (dict Dictionary) MarshalYAML() (any, error)
- func (dict Dictionary) Slice() []string
- func (dict *Dictionary) UnmarshalYAML(node *yaml.Node) error
- type DictionaryItem
- type Duration
- type Environment
- type Healthcheck
- type Ignored
- type Int
- type Interpolator
- type Link
- type Links
- type Logging
- type MapEnvironment
- type Network
- type PortMapping
- type PortMappingLongForm
- type PortMappings
- type PortRange
- type PortRangeWithProtocol
- type Project
- type ProjectConfigs
- type ProjectNetworks
- type ProjectSecrets
- type ProjectServices
- type ProjectVolumes
- type Secret
- type Service
- type ServiceDependencies
- type ServiceDependency
- type ServiceDependencyLongForm
- type ServiceNetwork
- type ServiceNetworkLongForm
- type ServiceNetworks
- type String
- type Strings
- type Style
- type ThrottleDevice
- type TmpfsOptions
- type Tuple
- type Ulimit
- type UlimitLongForm
- type Ulimits
- type Volume
- type VolumeMount
- type VolumeMountLongForm
- type VolumeOptions
- type WeightDevice
Constants ¶
const ( UnknownStyle Style = 0 MapStyle = 'M' SeqStyle = 'S' )
Variables ¶
var ErrEnvironment = template.ErrEnvironment
Functions ¶
func FormatPort ¶
Types ¶
type BindOptions ¶
type BindOptions struct { Propagation String `yaml:"propagation,omitempty"` CreateHostPath Bool `yaml:"create_host_path,omitempty"` }
func (*BindOptions) Interpolate ¶
func (opt *BindOptions) Interpolate(env Environment) error
type BlkioConfig ¶
type BlkioConfig struct { DeviceReadBPS []ThrottleDevice `yaml:"device_read_bps,omitempty"` DeviceWriteBPS []ThrottleDevice `yaml:"device_write_bps,omitempty"` DeviceReadIOPS []ThrottleDevice `yaml:"device_read_iops,omitempty"` DeviceWriteIOPS []ThrottleDevice `yaml:"device_write_iops,omitempty"` Weight Int `yaml:"weight,omitempty"` WeightDevice []WeightDevice `yaml:"weight_device,omitempty"` }
func (*BlkioConfig) Interpolate ¶
func (blkio *BlkioConfig) Interpolate(env Environment) error
type Bool ¶
func (*Bool) Interpolate ¶
func (b *Bool) Interpolate(env Environment) error
func (*Bool) UnmarshalYAML ¶
type Build ¶
type Build struct { ShortForm String BuildLongForm }
func (*Build) Interpolate ¶
func (b *Build) Interpolate(env Environment) error
func (Build) MarshalYAML ¶
func (*Build) UnmarshalYAML ¶
type BuildLongForm ¶
type BuildLongForm struct { Context String `yaml:"context,omitempty"` Dockerfile String `yaml:"dockerfile,omitempty"` Args Dictionary `yaml:"args,omitempty"` CacheFrom Strings `yaml:"cache_from,omitempty"` ExtraHosts Strings `yaml:"extra_hosts,omitempty"` Isolation String `yaml:"isolation,omitempty"` Labels Dictionary `yaml:"labels,omitempty"` ShmSize Bytes `yaml:"shm_size,omitempty"` Target String `yaml:"target,omitempty"` }
func (*BuildLongForm) Interpolate ¶
func (b *BuildLongForm) Interpolate(env Environment) error
type Bytes ¶
func (*Bytes) Interpolate ¶
func (bs *Bytes) Interpolate(env Environment) error
func (Bytes) MarshalYAML ¶
func (*Bytes) UnmarshalYAML ¶
type Command ¶
type Command struct { // IsShellForm is true if the command was provided as a string rather than an // array of strings. This indicates that it should be passed to the image's // shell as the first argument. IsShellForm bool Parts Strings }
func (*Command) Interpolate ¶
func (cmd *Command) Interpolate(env Environment) error
func (Command) MarshalYAML ¶
func (*Command) UnmarshalYAML ¶
type Config ¶
type Config struct { Key string `yaml:"-"` File String `yaml:"file,omitempty"` External Bool `yaml:"external,omitempty"` Name String `yaml:"name,omitempty"` }
func (*Config) Interpolate ¶
func (cfg *Config) Interpolate(env Environment) error
type DeviceMapping ¶
type DeviceMapping struct { String PathOnHost string PathInContainer string CgroupPermissions string }
func (*DeviceMapping) Interpolate ¶
func (dm *DeviceMapping) Interpolate(env Environment) error
func (DeviceMapping) MarshalYAML ¶
func (dm DeviceMapping) MarshalYAML() (any, error)
func (*DeviceMapping) UnmarshalYAML ¶
func (dm *DeviceMapping) UnmarshalYAML(node *yaml.Node) error
type Dictionary ¶
type Dictionary struct { Style Style Items []DictionaryItem }
Map of string to string that can be marshalled as either a !!map or a !!seq. In the seq style, entries are of the form "key" or "key=value".
func (*Dictionary) Interpolate ¶
func (dict *Dictionary) Interpolate(env Environment) error
func (Dictionary) Map ¶
func (dict Dictionary) Map() map[string]string
func (Dictionary) MapOfPtr ¶
func (dict Dictionary) MapOfPtr() map[string]*string
func (Dictionary) MarshalYAML ¶
func (dict Dictionary) MarshalYAML() (any, error)
func (Dictionary) Slice ¶
func (dict Dictionary) Slice() []string
func (*Dictionary) UnmarshalYAML ¶
func (dict *Dictionary) UnmarshalYAML(node *yaml.Node) error
type DictionaryItem ¶
type DictionaryItem struct { Style Style // For map style, String contains only the value. // For seq style, String is expected to evaluate to "key" or "key=value". String String Key string Value string // True in seq style when there is no "=" in the evaluated String. NoValue bool }
func (*DictionaryItem) Interpolate ¶
func (item *DictionaryItem) Interpolate(env Environment) error
func (DictionaryItem) MarshalYAML ¶
func (item DictionaryItem) MarshalYAML() (any, error)
func (*DictionaryItem) UnmarshalYAML ¶
func (item *DictionaryItem) UnmarshalYAML(node *yaml.Node) error
type Duration ¶
func (*Duration) Interpolate ¶
func (d *Duration) Interpolate(env Environment) error
func (Duration) MarshalYAML ¶
func (*Duration) UnmarshalYAML ¶
type Environment ¶
type Environment = template.Environment
type Healthcheck ¶
type Healthcheck struct { Test Command `yaml:"test,omitempty"` Interval Duration `yaml:"interval,omitempty"` Timeout Duration `yaml:"timeout,omitempty"` Retries Int `yaml:"retries,omitempty"` StartPeriod Duration `yaml:"start_period,omitempty"` }
func (*Healthcheck) Interpolate ¶
func (hc *Healthcheck) Interpolate(env Environment) error
type Ignored ¶
type Ignored struct{}
This is a temporary placeholder for fields that we presently don't support, but are safe to ignore. TODO: Eliminate all usages of this with actual parsing logic.
func (*Ignored) Interpolate ¶
func (_ *Ignored) Interpolate(env Environment) error
func (*Ignored) UnmarshalYAML ¶
type Int ¶
func (*Int) Interpolate ¶
func (i *Int) Interpolate(env Environment) error
func (*Int) UnmarshalYAML ¶
type Interpolator ¶
type Interpolator interface {
Interpolate(Environment) error
}
type Link ¶
func (*Link) Interpolate ¶
func (l *Link) Interpolate(env Environment) error
func (Link) MarshalYAML ¶
func (*Link) UnmarshalYAML ¶
type Logging ¶
type Logging struct { Driver String `yaml:"driver,omitempty"` Options Dictionary `yaml:"options,omitempty"` }
func (*Logging) Interpolate ¶
func (l *Logging) Interpolate(env Environment) error
type MapEnvironment ¶
type MapEnvironment = template.MapEnvironment
type Network ¶
type Network struct { Key string `yaml:"-"` Name String `yaml:"name,omitempty"` Driver String `yaml:"driver,omitempty"` DriverOpts Dictionary `yaml:"driver_opts,omitempty"` Attachable Bool `yaml:"attachable,omitempty"` EnableIPv6 Bool `yaml:"enable_ipv6,omitempty"` Internal Bool `yaml:"internal,omitempty"` Labels Dictionary `yaml:"labels,omitempty"` External Bool `yaml:"external,omitempty"` }
func (*Network) Interpolate ¶
func (n *Network) Interpolate(env Environment) error
type PortMapping ¶
type PortMapping struct { IsShortForm bool String PortMappingLongForm }
func (*PortMapping) Interpolate ¶
func (pm *PortMapping) Interpolate(env Environment) error
func (PortMapping) MarshalYAML ¶
func (pm PortMapping) MarshalYAML() (any, error)
func (*PortMapping) UnmarshalYAML ¶
func (pm *PortMapping) UnmarshalYAML(node *yaml.Node) error
type PortMappingLongForm ¶
type PortMappingLongForm struct { Target PortRange `yaml:"target,omitempty"` Published PortRange `yaml:"published,omitempty"` HostIP string `yaml:"host_ip,omitempty"` Protocol string `yaml:"protocol,omitempty"` Mode string `yaml:"mode,omitempty"` }
func ParsePortMapping ¶
func ParsePortMapping(short string) (PortMappingLongForm, error)
type PortMappings ¶
type PortMappings []PortMapping
func ParsePortMappings ¶
func ParsePortMappings(short string) (mappings PortMappings, err error)
func (*PortMappings) Interpolate ¶
func (pm *PortMappings) Interpolate(env Environment) error
func (PortMappings) MarshalYAML ¶
func (mappings PortMappings) MarshalYAML() (any, error)
type PortRange ¶
func (*PortRange) Interpolate ¶
func (rng *PortRange) Interpolate(env Environment) error
func (PortRange) MarshalYAML ¶
func (*PortRange) UnmarshalYAML ¶
type PortRangeWithProtocol ¶
func (*PortRangeWithProtocol) Interpolate ¶
func (rng *PortRangeWithProtocol) Interpolate(env Environment) error
func (PortRangeWithProtocol) MarshalYAML ¶
func (rng PortRangeWithProtocol) MarshalYAML() (any, error)
func (*PortRangeWithProtocol) UnmarshalYAML ¶
func (rng *PortRangeWithProtocol) UnmarshalYAML(node *yaml.Node) error
type Project ¶
type Project struct { Version String `yaml:"version,omitempty"` Services ProjectServices `yaml:"services,omitempty"` Networks ProjectNetworks `yaml:"networks,omitempty"` Volumes ProjectVolumes `yaml:"volumes,omitempty"` Configs ProjectConfigs `yaml:"configs,omitempty"` Secrets ProjectSecrets `yaml:"secrets,omitempty"` }
func (*Project) Interpolate ¶
func (project *Project) Interpolate(env Environment) error
type ProjectConfigs ¶
type ProjectConfigs []Config
func (*ProjectConfigs) Interpolate ¶
func (section *ProjectConfigs) Interpolate(env Environment) error
func (ProjectConfigs) MarshalYAML ¶
func (section ProjectConfigs) MarshalYAML() (any, error)
func (*ProjectConfigs) UnmarshalYAML ¶
func (section *ProjectConfigs) UnmarshalYAML(node *yaml.Node) error
type ProjectNetworks ¶
type ProjectNetworks []Network
func (*ProjectNetworks) Interpolate ¶
func (section *ProjectNetworks) Interpolate(env Environment) error
func (ProjectNetworks) MarshalYAML ¶
func (section ProjectNetworks) MarshalYAML() (any, error)
func (*ProjectNetworks) UnmarshalYAML ¶
func (section *ProjectNetworks) UnmarshalYAML(node *yaml.Node) error
type ProjectSecrets ¶
type ProjectSecrets []Secret
func (*ProjectSecrets) Interpolate ¶
func (section *ProjectSecrets) Interpolate(env Environment) error
func (ProjectSecrets) MarshalYAML ¶
func (section ProjectSecrets) MarshalYAML() (any, error)
func (*ProjectSecrets) UnmarshalYAML ¶
func (section *ProjectSecrets) UnmarshalYAML(node *yaml.Node) error
type ProjectServices ¶
type ProjectServices []Service
func (*ProjectServices) Interpolate ¶
func (section *ProjectServices) Interpolate(env Environment) error
func (ProjectServices) MarshalYAML ¶
func (section ProjectServices) MarshalYAML() (any, error)
func (*ProjectServices) UnmarshalYAML ¶
func (section *ProjectServices) UnmarshalYAML(node *yaml.Node) error
type ProjectVolumes ¶
type ProjectVolumes []Volume
func (*ProjectVolumes) Interpolate ¶
func (section *ProjectVolumes) Interpolate(env Environment) error
func (ProjectVolumes) MarshalYAML ¶
func (section ProjectVolumes) MarshalYAML() (any, error)
func (*ProjectVolumes) UnmarshalYAML ¶
func (section *ProjectVolumes) UnmarshalYAML(node *yaml.Node) error
type Secret ¶
type Secret struct { Key string `yaml:"-"` File String `yaml:"file,omitempty"` External Bool `yaml:"external,omitempty"` Name String `yaml:"name,omitempty"` }
func (*Secret) Interpolate ¶
func (s *Secret) Interpolate(env Environment) error
type Service ¶
type Service struct { Key string `yaml:"-"` // Note that these two are only applicable to Windows. CPUCount Int `yaml:"cpu_count,omitempty"` CPUPercent Int `yaml:"cpu_percent,omitempty"` CPUPeriod Int `yaml:"cpu_period,omitempty"` CPUQuota Int `yaml:"cpu_quota,omitempty"` CPURealtimeRuntime Duration `yaml:"cpu_rt_runtime,omitempty"` CPURealtimePeriod Duration `yaml:"cpu_rt_period,omitempty"` CPUSet String `yaml:"cpuset,omitempty"` BlkioConfig BlkioConfig `yaml:"blkio_config,omitempty"` Build Build `yaml:"build,omitempty"` CapAdd Strings `yaml:"cap_add,omitempty"` CapDrop Strings `yaml:"cap_drop,omitempty"` CgroupParent String `yaml:"cgroup_parent,omitempty"` Command Command `yaml:"command,omitempty"` Configs Strings `yaml:"configs,omitempty"` // TODO: support long syntax. ContainerName String `yaml:"container_name,omitempty"` // TODO: credential_spec DependsOn ServiceDependencies `yaml:"depends_on,omitempty"` DeviceCgroupRules Strings `yaml:"device_cgroup_rules,omitempty"` Devices []DeviceMapping `yaml:"devices,omitempty"` DNS Tuple `yaml:"dns,omitempty"` DNSOptions Strings `yaml:"dns_opt,omitempty"` DNSSearch Tuple `yaml:"dns_search,omitempty"` Domainname String `yaml:"domainname,omitempty"` Entrypoint Command `yaml:"entrypoint,omitempty"` EnvFile Tuple `yaml:"env_file,omitempty"` Environment Dictionary `yaml:"environment,omitempty"` Expose []PortRangeWithProtocol `yaml:"expose,omitempty"` // TODO: extends // List of links of the form `SERVICE` or `SERVICE:ALIAS` ExternalLinks Strings `yaml:"external_links,omitempty"` // List of host/IP pairs to add to /etc/hosts of the form `HOST:IP` ExtraHosts Strings `yaml:"extra_hosts,omitempty"` GroupAdd Strings `yaml:"group_add,omitempty"` Healthcheck *Healthcheck `yaml:"healthcheck,omitempty"` Hostname String `yaml:"hostname,omitempty"` Image String `yaml:"image,omitempty"` Init *Bool `yaml:"init,omitempty"` IPC String `yaml:"ipc,omitempty"` Isolation String `yaml:"isolation,omitempty"` Labels Dictionary `yaml:"labels,omitempty"` Links Links `yaml:"links,omitempty"` Logging Logging `yaml:"logging,omitempty"` NetworkMode String `yaml:"network_mode,omitempty"` Networks ServiceNetworks `yaml:"networks,omitempty"` MacAddress String `yaml:"mac_address,omitempty"` MemorySwappiness *Int `yaml:"mem_swappiness,omitempty"` // MemoryLimit and MemoryReservation can be specified either as strings or integers. // TODO: Deprecate these fields once we support `deploy.limits.memory` and `deploy.reservations.memory`. MemoryLimit Bytes `yaml:"mem_limit,omitempty"` MemoryReservation Bytes `yaml:"mem_reservation,omitempty"` MemswapLimit Bytes `yaml:"memswap_limit,omitempty"` OomKillDisable *Bool `yaml:"oom_kill_disable,omitempty"` OomScoreAdj Int `yaml:"oom_score_adj,omitempty"` PidMode String `yaml:"pid,omitempty"` PidsLimit *Int `yaml:"pids_limit,omitempty"` Platform String `yaml:"platform,omitempty"` Ports PortMappings `yaml:"ports,omitempty"` Privileged Bool `yaml:"privileged,omitempty"` // TODO: Support profiles. See https://docs.docker.com/compose/profiles/. Profiles Ignored `yaml:"profiles,omitempty"` PullPolicy String `yaml:"pull_policy,omitempty"` ReadOnly Bool `yaml:"read_only,omitempty"` Restart String `yaml:"restart,omitempty"` Runtime String `yaml:"runtime,omitempty"` SecurityOpt Strings `yaml:"security_opt,omitempty"` ShmSize Bytes `yaml:"shm_size,omitempty"` StdinOpen Bool `yaml:"stdin_open,omitempty"` StopGracePeriod *Duration `yaml:"stop_grace_period,omitempty"` StopSignal String `yaml:"stop_signal,omitempty"` StorageOpt Dictionary `yaml:"storage_opt,omitempty"` Sysctls Dictionary `yaml:"sysctls,omitempty"` Tmpfs Tuple `yaml:"tmpfs,omitempty"` TTY Bool `yaml:"tty,omitempty"` Ulimits Ulimits `yaml:"ulimits,omitempty"` User String `yaml:"user,omitempty"` UsernsMode String `yaml:"userns_mode,omitempty"` Volumes []VolumeMount `yaml:"volumes,omitempty"` VolumesFrom Strings `yaml:"volumes_from,omitempty"` WorkingDir String `yaml:"working_dir,omitempty"` // NOTE [DOCKER SWARM FEATURES]: // Docker-Compose manages local, single-container deployments as well as Docker Swarm // deployments. Since Swarm is not as widely used as Kubernetes, support for the Swarm // features that Docker-Compose includes is not a top priority. The settings listed // below are the ones that are applicable to a Swarm deployment. Deploy Ignored `yaml:"deploy,omitempty"` Scale Ignored `yaml:"scale,omitempty"` Secrets Ignored `yaml:"secrets,omitempty"` }
func (*Service) Interpolate ¶
func (service *Service) Interpolate(env Environment) error
type ServiceDependencies ¶
type ServiceDependencies struct { Style Style Items []ServiceDependency }
func (*ServiceDependencies) Interpolate ¶
func (deps *ServiceDependencies) Interpolate(env Environment) error
func (ServiceDependencies) MarshalYAML ¶
func (deps ServiceDependencies) MarshalYAML() (any, error)
func (*ServiceDependencies) UnmarshalYAML ¶
func (deps *ServiceDependencies) UnmarshalYAML(node *yaml.Node) error
type ServiceDependency ¶
type ServiceDependency struct { IsShortSyntax bool Service String ServiceDependencyLongForm }
func (*ServiceDependency) Interpolate ¶
func (dep *ServiceDependency) Interpolate(env Environment) error
func (ServiceDependency) MarshalYAML ¶
func (dep ServiceDependency) MarshalYAML() (any, error)
func (*ServiceDependency) UnmarshalYAML ¶
func (dep *ServiceDependency) UnmarshalYAML(node *yaml.Node) error
type ServiceDependencyLongForm ¶
type ServiceDependencyLongForm struct {
Condition String `yaml:"condition,omitempty"`
}
func (*ServiceDependencyLongForm) Interpolate ¶
func (dep *ServiceDependencyLongForm) Interpolate(env Environment) error
type ServiceNetwork ¶
type ServiceNetwork struct { Key string ShortForm String ServiceNetworkLongForm }
func (*ServiceNetwork) Interpolate ¶
func (sn *ServiceNetwork) Interpolate(env Environment) error
func (ServiceNetwork) MarshalYAML ¶
func (sn ServiceNetwork) MarshalYAML() (any, error)
func (*ServiceNetwork) UnmarshalYAML ¶
func (sn *ServiceNetwork) UnmarshalYAML(node *yaml.Node) error
type ServiceNetworkLongForm ¶
type ServiceNetworkLongForm struct { Aliases Strings `yaml:"aliases,omitempty"` IPV4Address String `yaml:"ipv4_address,omitempty"` IPV6Address String `yaml:"ipv6_address,omitempty"` LinkLocalIPs Strings `yaml:"link_local_ips,omitempty"` Priority Int `yaml:"priority,omitempty"` }
func (*ServiceNetworkLongForm) Interpolate ¶
func (sn *ServiceNetworkLongForm) Interpolate(env Environment) error
type ServiceNetworks ¶
type ServiceNetworks struct { Style Style Items []ServiceNetwork }
func (*ServiceNetworks) Interpolate ¶
func (sn *ServiceNetworks) Interpolate(env Environment) error
func (ServiceNetworks) MarshalYAML ¶
func (sn ServiceNetworks) MarshalYAML() (any, error)
func (*ServiceNetworks) UnmarshalYAML ¶
func (sn *ServiceNetworks) UnmarshalYAML(node *yaml.Node) error
type String ¶
String is a scalar leaf node in a compose document. Non-string types generally embed a String to facilitate interpolation. See the package documentation.
func MakeString ¶
func (*String) Interpolate ¶
func (s *String) Interpolate(env Environment) error
func (String) MarshalYAML ¶
func (*String) UnmarshalYAML ¶
type Style ¶
type Style byte
Some sections and subsections can be expressed as either a map or sequence. Style records the original kind of syntax used in the source YAML.
type ThrottleDevice ¶
type ThrottleDevice struct { Path String `yaml:"path,omitempty"` Rate Bytes `yaml:"rate,omitempty"` }
func (*ThrottleDevice) Interpolate ¶
func (td *ThrottleDevice) Interpolate(env Environment) error
type TmpfsOptions ¶
type TmpfsOptions struct {
Size Bytes `yaml:"size,omitempty"`
}
func (*TmpfsOptions) Interpolate ¶
func (opt *TmpfsOptions) Interpolate(env Environment) error
type Tuple ¶
A sequence of strings that may be marshalled as an individual string.
func (*Tuple) Interpolate ¶
func (tup *Tuple) Interpolate(env Environment) error
func (Tuple) MarshalYAML ¶
func (*Tuple) UnmarshalYAML ¶
type Ulimit ¶
type Ulimit struct { Name string ShortForm Int UlimitLongForm }
func (*Ulimit) Interpolate ¶
func (ul *Ulimit) Interpolate(env Environment) error
func (Ulimit) MarshalYAML ¶
func (*Ulimit) UnmarshalYAML ¶
type UlimitLongForm ¶
func (*UlimitLongForm) Interpolate ¶
func (ul *UlimitLongForm) Interpolate(env Environment) error
type Ulimits ¶
type Ulimits []Ulimit
func (*Ulimits) Interpolate ¶
func (uls *Ulimits) Interpolate(env Environment) error
func (Ulimits) MarshalYAML ¶
func (*Ulimits) UnmarshalYAML ¶
type Volume ¶
type Volume struct { Key string `yaml:"-"` Driver String `yaml:"driver,omitempty"` DriverOpts Dictionary `yaml:"driver_opts,omitempty"` // TODO: external Labels Dictionary `yaml:"labels,omitempty"` Name String `yaml:"name,omitempty"` }
func (*Volume) Interpolate ¶
func (v *Volume) Interpolate(env Environment) error
type VolumeMount ¶
type VolumeMount struct { ShortForm String VolumeMountLongForm }
func (*VolumeMount) Interpolate ¶
func (vm *VolumeMount) Interpolate(env Environment) error
func (VolumeMount) MarshalYAML ¶
func (vm VolumeMount) MarshalYAML() (any, error)
func (*VolumeMount) UnmarshalYAML ¶
func (vm *VolumeMount) UnmarshalYAML(node *yaml.Node) error
type VolumeMountLongForm ¶
type VolumeMountLongForm struct { Type String `yaml:"type,omitempty"` Source String `yaml:"source,omitempty"` Target String `yaml:"target,omitempty"` ReadOnly Bool `yaml:"read_only,omitempty"` Bind *BindOptions `yaml:"bind,omitempty"` Volume *VolumeOptions `yaml:"volume,omitempty"` Tmpfs *TmpfsOptions `yaml:"tmpfs,omitempty"` Consistency *Ignored `yaml:"consistency,omitempty"` }
func (*VolumeMountLongForm) Interpolate ¶
func (vm *VolumeMountLongForm) Interpolate(env Environment) error
type VolumeOptions ¶
type VolumeOptions struct {
Nocopy Bool `yaml:"nocopy,omitempty"`
}
func (*VolumeOptions) Interpolate ¶
func (opt *VolumeOptions) Interpolate(env Environment) error
type WeightDevice ¶
type WeightDevice struct { Path String `yaml:"path,omitempty"` Weight Int `yaml:"weight,omitempty"` }
func (*WeightDevice) Interpolate ¶
func (wd *WeightDevice) Interpolate(env Environment) error
Source Files
¶
- blkio.go
- bool.go
- build.go
- bytes.go
- command.go
- config.go
- devicemapping.go
- dictionary.go
- doc.go
- duration.go
- healthcheck.go
- ignored.go
- interpolate.go
- link.go
- logging.go
- network.go
- numbers.go
- ports.go
- project.go
- secret.go
- service.go
- servicedependency.go
- servicenetwork.go
- string.go
- style.go
- testutil.go
- tuple.go
- ulimit.go
- volume.go
- volumemount.go