Documentation ¶
Overview ¶
Package yaml is an implementation of yaml compiler.
Package yaml is an implementation of yaml compiler.
Index ¶
- func IsBuildArray(build Build) bool
- func IsPrebuildArray(prebuild PreBuild) bool
- type Application
- type AuthConfig
- type Build
- type BuildStep
- type Command
- type Config
- type Container
- type Containerslice
- type DeployStep
- type IntegrationStep
- type MapEqualSlice
- type PreBuild
- type PreBuildStep
- type Stringorslice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBuildArray ¶
IsBuildArray checks if there is a build array.
func IsPrebuildArray ¶
IsPrebuildArray checks if there is a array of prebuild step.
Types ¶
type Application ¶
type Application struct { ClusterType string `yaml:"type"` // kubernetes, caicloud_claas, mesos ClusterHost string `yaml:"host"` ClusterToken string `yaml:"token"` ClusterName string `yaml:"cluster"` NamespaceName string `yaml:"namespace"` DeploymentName string `yaml:"deployment"` Containers []string `yaml:"containers"` }
Application contains information that helps locating a application, and deploying image to its containers.
type AuthConfig ¶
type AuthConfig struct { Username string `yaml:"username"` Password string `yaml:"password"` Email string `yaml:"email"` RegistryToken string `yaml:"registry_token"` }
AuthConfig is the type for auth for Docker Image Registry.
type Build ¶
type Build struct { DockerfilePath string `yaml:"context_dir"` DockerfileName string `yaml:"dockerfile_name"` Container `yaml:",inline"` Commands []string `yaml:"commands"` }
Build is a typed representation of the build step in the Yaml configuration file.
type BuildStep ¶
type BuildStep struct {
// contains filtered or unexported fields
}
BuildStep holds the build step configuration using a custom Yaml unmarshal function to preserve ordering.
func (*BuildStep) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaller interface.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is the type for command field in yml config.
func (*Command) UnmarshalYAML ¶
UnmarshalYAML implements the Unmarshaller interface.
type Config ¶
type Config struct { Integration IntegrationStep `yaml:"integration"` PreBuild PreBuildStep `yaml:"pre_build"` Build BuildStep `yaml:"build"` PostBuild BuildStep `yaml:"post_build"` Deploy DeployStep `yaml:",inline"` }
Config is a typed representation of the Yaml configuration file.
func ParseString ¶
ParseString parses a Yaml configuration file in string format.
type Container ¶
type Container struct { // Name is used by service block. Name string `yaml:"name"` Image string `yaml:"image"` Pull bool `yaml:"pull"` Privileged bool `yaml:"privileged"` Environment MapEqualSlice `yaml:"environment"` Entrypoint Command `yaml:"entrypoint"` Command Command `yaml:"command"` ExtraHosts []string `yaml:"extra_hosts"` Volumes []string `yaml:"volumes"` Devices []string `yaml:"devices"` Net string `yaml:"net"` DNS Stringorslice `yaml:"dns"` AuthConfig AuthConfig `yaml:"auth_config"` Memory int64 `yaml:"mem_limit"` CPUSetCPUs string `yaml:"cpuset"` OomKillDisable bool `yaml:"oom_kill_disable"` }
Container is a typed representation of a docker step in the Yaml configuration file.
type Containerslice ¶
type Containerslice struct {
// contains filtered or unexported fields
}
Containerslice is a slice of Containers with a custom Yaml unarmshal function to preserve ordering.
func (*Containerslice) Slice ¶
func (s *Containerslice) Slice() []Container
Slice gets the parts of the Containerslice as a Slice of string.
func (*Containerslice) UnmarshalYAML ¶
func (s *Containerslice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaller interface.
type DeployStep ¶
type DeployStep struct {
Applications []Application `yaml:"deploy"`
}
DeployStep deploys version to multiple applications.
type IntegrationStep ¶
type IntegrationStep struct {
// contains filtered or unexported fields
}
IntegrationStep holds the integration step configuration using a custom Yaml unmarshal function to preserve ordering.
func (*IntegrationStep) Build ¶
func (i *IntegrationStep) Build() Build
Build gets the build of IntegrationStep.
func (*IntegrationStep) ServiceSlice ¶
func (i *IntegrationStep) ServiceSlice() []Container
ServiceSlice gets the parts of service in the IntegrationStep as a Slice of string.
func (*IntegrationStep) UnmarshalYAML ¶
func (i *IntegrationStep) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaller interface.
type MapEqualSlice ¶
type MapEqualSlice struct {
// contains filtered or unexported fields
}
MapEqualSlice is the type for env map slice.
func (*MapEqualSlice) Slice ¶
func (s *MapEqualSlice) Slice() []string
Slice gets the parts of the MapEqualSlice as a Slice of string.
func (*MapEqualSlice) UnmarshalYAML ¶
func (s *MapEqualSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaller interface.
type PreBuild ¶
type PreBuild struct { DockerfilePath string `yaml:"context_dir"` DockerfileName string `yaml:"dockerfile_name"` Container `yaml:",inline"` Commands []string `yaml:"commands"` Outputs []string `yaml:"outputs"` }
PreBuild is a typed representation of the pre_build step in the Yaml configuration file.
type PreBuildStep ¶
type PreBuildStep struct {
// contains filtered or unexported fields
}
PreBuildStep holds the pre_build step configuration using a custom Yaml unarmshal function to preserve ordering.
func (*PreBuildStep) Slice ¶
func (s *PreBuildStep) Slice() []PreBuild
Slice gets the parts of the PreBuildStep as a Slice of string.
func (*PreBuildStep) UnmarshalYAML ¶
func (s *PreBuildStep) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaller interface.
type Stringorslice ¶
type Stringorslice struct {
// contains filtered or unexported fields
}
Stringorslice represents a string or an array of strings. TODO use docker/docker/pkg/stringutils.StrSlice once 1.9.x is released.
func (*Stringorslice) Len ¶
func (s *Stringorslice) Len() int
Len returns the number of parts of the Stringorslice.
func (Stringorslice) MarshalYAML ¶
func (s Stringorslice) MarshalYAML() (interface{}, error)
MarshalYAML implements the Marshaller interface.
func (*Stringorslice) Slice ¶
func (s *Stringorslice) Slice() []string
Slice gets the parts of the StrSlice as a Slice of string.
func (*Stringorslice) UnmarshalYAML ¶
func (s *Stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the Unmarshaller interface.