yaml

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package yaml is an implementation of yaml compiler.

Package yaml is an implementation of yaml compiler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBuildArray

func IsBuildArray(build Build) bool

IsBuildArray checks if there is a build array.

func IsPrebuildArray

func IsPrebuildArray(prebuild PreBuild) bool

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) Slice

func (s *BuildStep) Slice() []Build

Slice gets the parts of the BuildStep as a Slice of string.

func (*BuildStep) UnmarshalYAML

func (s *BuildStep) UnmarshalYAML(unmarshal func(interface{}) error) error

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) Slice

func (s *Command) Slice() []string

Slice gets the parts of the Slice as a Slice of string.

func (*Command) UnmarshalYAML

func (s *Command) UnmarshalYAML(unmarshal func(interface{}) error) error

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 Parse

func Parse(in []byte) (*Config, error)

Parse parses a Yaml configuration file.

func ParseString

func ParseString(in string) (*Config, error)

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"`
	Ports          Ports         `yaml:"ports"`
	Links          Links         `yaml:"links"`
	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 Links struct {
	// contains filtered or unexported fields
}

Links is the type for link field in yml config.

func (*Links) Slice

func (s *Links) Slice() []string

Slice gets the parts of the Slice as a Slice of string.

func (*Links) UnmarshalYAML

func (s *Links) 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 Ports

type Ports struct {
	// contains filtered or unexported fields
}

Ports is the type for port field in yml config.

func (*Ports) Slice

func (s *Ports) Slice() []string

Slice gets the parts of the Slice as a Slice of string.

func (*Ports) UnmarshalYAML

func (s *Ports) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL