configuration

package
v0.1.3-1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDockerEndpoint define the default docker endpoint used in Configuration.
	DefaultDockerEndpoint = "unix:///var/run/docker.sock"
	// DefaultComposePull define the default pull option with "docker build".
	DefaultComposePull = true
	// DefaultComposeNoCache define the default no-cache option with "docker build".
	DefaultComposeNoCache = false
)

Variables

View Source
var (
	// ErrOutputRequired is returned when output isn't defined in the configuration.
	ErrOutputRequired = errors.New("configuration(output): a path is required")
	// ErrPathRequired is returned when path isn't defined in the configuration.
	ErrPathRequired = errors.New("configuration(install): path is required")
	// ErrImageRequired is returned when path isn't defined in the configuration.
	ErrImageRequired = errors.New("configuration(install): image is required")
	// ErrNameRequired is returned when image name isn't defined in the configuration.
	ErrNameRequired = errors.New("configuration(compose): name is required")
	// ErrHostnameRequired is returned when registry hostname isn't defined in the configuration.
	ErrHostnameRequired = errors.New("configuration(publish): hostname is required")
	// ErrConfigurationEmpty is returned when the configuration is empty.
	ErrConfigurationEmpty = errors.New("configuration is required")
)

Functions

func Validate

func Validate(c *Configuration) error

Validate return an error if the given Configuration has flaw.

Types

type Compose

type Compose struct {
	Name    string
	NoCache bool `yaml:"no-cache"`
	Pull    bool
}

Compose contains compose runtime's configuration.

type Configuration

type Configuration struct {
	DockerEndpoint string `yaml:"docker-endpoint"`
	Install        Install
	Compose        Compose
	Publish        Publish
}

Configuration contains pack runtime instructions.

func New

func New() *Configuration

New return a default Configuration.

func Parse

func Parse(path string) (*Configuration, error)

Parse a file path and inflate a new Configuration

func (*Configuration) Configure

func (c *Configuration) Configure(remote string) error

Configure will analyze the given remote identifier and define the required parameters for Compose and Publish modules.

func (*Configuration) DisableCache

func (c *Configuration) DisableCache()

DisableCache disable cache for Compose module.

func (*Configuration) DisableInstall

func (c *Configuration) DisableInstall()

DisableInstall disable Install module.

func (*Configuration) DisablePull

func (c *Configuration) DisablePull()

DisablePull disable pull for Compose module.

func (*Configuration) EnableCache

func (c *Configuration) EnableCache()

EnableCache enable cache for Compose module.

func (*Configuration) EnableInstall

func (c *Configuration) EnableInstall()

EnableInstall enable Install module.

func (*Configuration) EnablePull

func (c *Configuration) EnablePull()

EnablePull enable pull for Compose module.

func (*Configuration) Validate

func (c *Configuration) Validate() error

Validate is just a wrapper for the static function with the same name. Which mean that it will return an error if the given Configuration has flaw.

type Install

type Install struct {
	Disable     bool
	Image       string
	Path        string
	Output      string
	Command     string
	Environment []string
	Volumes     []string
	Links       []string
}

Install contains install runtime's configuration.

type Publish

type Publish struct {
	Hostname string
}

Publish contains publish runtime's configuration.

Jump to

Keyboard shortcuts

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