dockercompose

package module
v0.0.0-...-8aa572e Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: BSD-2-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compose

type Compose struct {
	ComposeConfig `yaml:",inline"`

	Services map[string]*Service
	Networks map[string]*Network
	// contains filtered or unexported fields
}

func NewCompose

func NewCompose(compose ComposeConfig) *Compose

func (*Compose) AddNetwork

func (c *Compose) AddNetwork(name string, networkConfig NetworkConfig) *Network

func (*Compose) AddService

func (c *Compose) AddService(name string, serviceConfig ServiceConfig, networks []ServiceNetworkConfig) *Service

func (*Compose) BuildDocker

func (c *Compose) BuildDocker(name, script string) (string, error)

func (*Compose) BuildDockerPath

func (c *Compose) BuildDockerPath(name, path string) (string, error)

func (*Compose) Clear

func (c *Compose) Clear() error

func (*Compose) Logs

func (c *Compose) Logs(machine ...string) (string, error)

func (*Compose) Start

func (c *Compose) Start() error

func (*Compose) Stop

func (c *Compose) Stop() error

type ComposeConfig

type ComposeConfig struct {
	Version string
}

type Network

type Network struct {
	NetworkConfig `yaml:",inline"`
	// contains filtered or unexported fields
}

func (*Network) GetCIDR

func (n *Network) GetCIDR() (string, error)

type NetworkConfig

type NetworkConfig struct {
}

type Service

type Service struct {
	ServiceConfig `yaml:",inline"`
	ContainerName string `yaml:"container_name"`

	Networks map[string]ServiceNetworkConfig `yaml:"networks"`
	// contains filtered or unexported fields
}

func (*Service) Exec

func (s *Service) Exec(path string, args ...string) exec.Cmd

func (*Service) GetIPAddressForNetwork

func (s *Service) GetIPAddressForNetwork(network *Network) (string, error)

func (*Service) SetNetworks

func (s *Service) SetNetworks(serviceNetworksConfig []ServiceNetworkConfig)

func (*Service) SudoExec

func (s *Service) SudoExec(path string, args ...string) exec.Cmd

type ServiceConfig

type ServiceConfig struct {
	Image      string
	Command    []string `yaml:"command,omitempty"`
	Privileged bool
}

type ServiceNetworkConfig

type ServiceNetworkConfig struct {
	Network *Network `yaml:"-"`
	Aliases []string `yaml:"aliases,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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