types

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	// common
	Name       string             `yaml:"name,omitempty"`
	Image      string             `yaml:"image,omitempty"`
	Pull       bool               `yaml:"pull,omitempty"`
	Commands   base.StringOrSlice `yaml:"commands,omitempty"`
	Entrypoint base.StringOrSlice `yaml:"entrypoint,omitempty"`
	Directory  string             `yaml:"directory,omitempty"`
	Settings   map[string]any     `yaml:"settings"`
	// flow control
	DependsOn base.StringOrSlice `yaml:"depends_on,omitempty"`
	When      constraint.When    `yaml:"when,omitempty"`
	Failure   string             `yaml:"failure,omitempty"`
	Detached  bool               `yaml:"detach,omitempty"`
	// state
	Volumes Volumes `yaml:"volumes,omitempty"`
	// network
	Ports     []string           `yaml:"ports,omitempty"`
	DNS       base.StringOrSlice `yaml:"dns,omitempty"`
	DNSSearch base.StringOrSlice `yaml:"dns_search,omitempty"`
	// backend specific
	BackendOptions map[string]any `yaml:"backend_options,omitempty"`

	// TODO: remove base.EnvironmentMap and use map[string]any after v3.0.0 release
	Environment base.EnvironmentMap `yaml:"environment,omitempty"`

	// Remove after v3.1.0
	Secrets []any `yaml:"secrets,omitempty"`

	// Docker and Kubernetes Specific
	Privileged bool `yaml:"privileged,omitempty"`

	// Undocumented
	Devices     []string `yaml:"devices,omitempty"`
	ExtraHosts  []string `yaml:"extra_hosts,omitempty"`
	NetworkMode string   `yaml:"network_mode,omitempty"`
	Tmpfs       []string `yaml:"tmpfs,omitempty"`
}

Container defines a container.

func (*Container) IsPlugin

func (c *Container) IsPlugin() bool

func (*Container) IsTrustedCloneImage

func (c *Container) IsTrustedCloneImage(trustedClonePlugins []string) bool

type ContainerList

type ContainerList struct {
	ContainerList []*Container
}

ContainerList denotes an ordered collection of containers.

func (*ContainerList) UnmarshalYAML

func (c *ContainerList) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the Unmarshaler interface.

type Network

type Network struct {
	Name        string   `yaml:"-"`
	Aliases     []string `yaml:"aliases,omitempty"`
	IPv4Address string   `yaml:"ipv4_address,omitempty"`
	IPv6Address string   `yaml:"ipv6_address,omitempty"`
}

Network represents a service network in compose file.

type Networks

type Networks struct {
	Networks []*Network
}

Networks represents a list of service networks in compose file. It has several representation, hence this specific struct.

func (Networks) MarshalYAML

func (n Networks) MarshalYAML() (any, error)

MarshalYAML implements the Marshaller interface.

func (*Networks) UnmarshalYAML

func (n *Networks) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the Unmarshaler interface.

type Volume

type Volume struct {
	Source      string `yaml:"-"`
	Destination string `yaml:"-"`
	AccessMode  string `yaml:"-"`
}

Volume represent a service volume.

func (*Volume) String

func (v *Volume) String() string

String implements the Stringer interface.

type Volumes

type Volumes struct {
	Volumes []*Volume
}

Volumes represents a list of service volumes in compose file. It has several representation, hence this specific struct.

func (Volumes) MarshalYAML

func (v Volumes) MarshalYAML() (any, error)

MarshalYAML implements the Marshaller interface.

func (*Volumes) UnmarshalYAML

func (v *Volumes) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the Unmarshaler interface.

type Workflow

type Workflow struct {
	When      constraint.When   `yaml:"when,omitempty"`
	Workspace Workspace         `yaml:"workspace,omitempty"`
	Clone     ContainerList     `yaml:"clone,omitempty"`
	Steps     ContainerList     `yaml:"steps,omitempty"`
	Services  ContainerList     `yaml:"services,omitempty"`
	Labels    map[string]string `yaml:"labels,omitempty"`
	DependsOn []string          `yaml:"depends_on,omitempty"`
	RunsOn    []string          `yaml:"runs_on,omitempty"`
	SkipClone bool              `yaml:"skip_clone"`
}

Workflow defines a workflow configuration.

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