yaml

package
v0.8.96 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	Username string
	Password string
	Email    string
}

AuthConfig defines registry authentication credentials.

type Config

type Config struct {
	Cache     libcompose.Stringorslice
	Platform  string
	Branches  Constraint
	Workspace Workspace
	Clone     Containers
	Pipeline  Containers
	Services  Containers
	Networks  Networks
	Volumes   Volumes
	Labels    libcompose.SliceorMap
}

Config defines a pipeline configuration.

func Parse

func Parse(r io.Reader) (*Config, error)

Parse parses the configuration from bytes b.

func ParseBytes

func ParseBytes(b []byte) (*Config, error)

ParseBytes parses the configuration from bytes b.

func ParseFile

func ParseFile(p string) (*Config, error)

ParseFile parses the configuration from path p.

func ParseString

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

ParseString parses the configuration from string s.

type Constraint

type Constraint struct {
	Include []string
	Exclude []string
}

Constraint defines a runtime constraint.

func (*Constraint) Excludes

func (c *Constraint) Excludes(v string) bool

Excludes returns true if the string matches the exclude patterns.

func (*Constraint) Includes

func (c *Constraint) Includes(v string) bool

Includes returns true if the string matches the include patterns.

func (*Constraint) Match

func (c *Constraint) Match(v string) bool

Match returns true if the string matches the include patterns and does not match any of the exclude patterns.

func (*Constraint) UnmarshalYAML

func (c *Constraint) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals the constraint.

type ConstraintMap

type ConstraintMap struct {
	Include map[string]string
	Exclude map[string]string
}

ConstraintMap defines a runtime constraint map.

func (*ConstraintMap) Match

func (c *ConstraintMap) Match(params map[string]string) bool

Match returns true if the params matches the include key values and does not match any of the exclude key values.

func (*ConstraintMap) UnmarshalYAML

func (c *ConstraintMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals the constraint map.

type Constraints

type Constraints struct {
	Ref         Constraint
	Repo        Constraint
	Instance    Constraint
	Platform    Constraint
	Environment Constraint
	Event       Constraint
	Branch      Constraint
	Status      Constraint
	Matrix      ConstraintMap
	Local       types.BoolTrue
}

Constraints defines a set of runtime constraints.

func (*Constraints) Match

func (c *Constraints) Match(metadata frontend.Metadata) bool

Match returns true if all constraints match the given input. If a single constraint fails a false value is returned.

type Container

type Container struct {
	AuthConfig    AuthConfig                `yaml:"auth_config,omitempty"`
	CapAdd        []string                  `yaml:"cap_add,omitempty"`
	CapDrop       []string                  `yaml:"cap_drop,omitempty"`
	Command       libcompose.Command        `yaml:"command,omitempty"`
	Commands      libcompose.Stringorslice  `yaml:"commands,omitempty"`
	CPUQuota      libcompose.StringorInt    `yaml:"cpu_quota,omitempty"`
	CPUSet        string                    `yaml:"cpuset,omitempty"`
	CPUShares     libcompose.StringorInt    `yaml:"cpu_shares,omitempty"`
	Detached      bool                      `yaml:"detach,omitempty"`
	Devices       []string                  `yaml:"devices,omitempty"`
	Tmpfs         []string                  `yaml:"tmpfs,omitempty"`
	DNS           libcompose.Stringorslice  `yaml:"dns,omitempty"`
	DNSSearch     libcompose.Stringorslice  `yaml:"dns_search,omitempty"`
	Entrypoint    libcompose.Command        `yaml:"entrypoint,omitempty"`
	Environment   libcompose.SliceorMap     `yaml:"environment,omitempty"`
	ExtraHosts    []string                  `yaml:"extra_hosts,omitempty"`
	Group         string                    `yaml:"group,omitempty"`
	Image         string                    `yaml:"image,omitempty"`
	Isolation     string                    `yaml:"isolation,omitempty"`
	Labels        libcompose.SliceorMap     `yaml:"labels,omitempty"`
	MemLimit      libcompose.MemStringorInt `yaml:"mem_limit,omitempty"`
	MemSwapLimit  libcompose.MemStringorInt `yaml:"memswap_limit,omitempty"`
	MemSwappiness libcompose.MemStringorInt `yaml:"mem_swappiness,omitempty"`
	Name          string                    `yaml:"name,omitempty"`
	NetworkMode   string                    `yaml:"network_mode,omitempty"`
	IpcMode       string                    `yaml:"ipc_mode,omitempty"`
	Networks      libcompose.Networks       `yaml:"networks,omitempty"`
	Privileged    bool                      `yaml:"privileged,omitempty"`
	Pull          bool                      `yaml:"pull,omitempty"`
	ShmSize       libcompose.MemStringorInt `yaml:"shm_size,omitempty"`
	Ulimits       libcompose.Ulimits        `yaml:"ulimits,omitempty"`
	Volumes       libcompose.Volumes        `yaml:"volumes,omitempty"`
	Secrets       Secrets                   `yaml:"secrets,omitempty"`
	Sysctls       libcompose.SliceorMap     `yaml:"sysctls,omitempty"`
	Constraints   Constraints               `yaml:"when,omitempty"`
	Vargs         map[string]interface{}    `yaml:",inline"`
}

Container defines a container.

type Containers

type Containers struct {
	Containers []*Container
}

Containers denotes an ordered collection of containers.

func (*Containers) UnmarshalYAML

func (c *Containers) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaller interface.

type Network

type Network struct {
	Name       string            `yaml:"name,omitempty"`
	Driver     string            `yaml:"driver,omitempty"`
	DriverOpts map[string]string `yaml:"driver_opts,omitempty"`
}

Network defines a container network.

type Networks

type Networks struct {
	Networks []*Network
}

Networks defines a collection of networks.

func (*Networks) UnmarshalYAML

func (n *Networks) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaller interface.

type Secret

type Secret struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
}

Secret defines a container secret.

type Secrets

type Secrets struct {
	Secrets []*Secret
}

Secrets defines a collection of secrets.

func (*Secrets) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaller interface.

type Volume

type Volume struct {
	Name       string            `yaml:"name,omitempty"`
	Driver     string            `yaml:"driver,omitempty"`
	DriverOpts map[string]string `yaml:"driver_opts,omitempty"`
}

Volume defines a container volume.

type Volumes

type Volumes struct {
	Volumes []*Volume
}

Volumes defines a collection of volumes.

func (*Volumes) UnmarshalYAML

func (v *Volumes) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaller interface.

type Workspace

type Workspace struct {
	Base string
	Path string
}

Workspace defines a pipeline workspace.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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