manifest

package
v0.0.0-...-f476983 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0, Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdout       = io.Writer(os.Stdout)
	Stderr       = io.Writer(os.Stderr)
	Execer       = exec.Command
	SignalWaiter = waitForSignal
)

NOTE: these vars allow us to control other shell-outs during testing

View Source
var RandomPort = func() int {
	return 10000 + rand.Intn(50000)
}

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func Init

func Init(dir string) error

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type ExternalNetwork

type ExternalNetwork Network

type Files

type Files map[string]time.Time

type InternalNetwork

type InternalNetwork map[string]ExternalNetwork

type Manifest

type Manifest map[string]ManifestEntry

func Read

func Read(dir, filename string) (*Manifest, error)

func (*Manifest) Build

func (m *Manifest) Build(app, dir string, cache bool) []error

func (*Manifest) MissingEnvironment

func (m *Manifest) MissingEnvironment(cache bool, app string) ([]string, error)

func (*Manifest) PortConflicts

func (m *Manifest) PortConflicts(shift int) ([]string, error)

func (*Manifest) PortsWanted

func (m *Manifest) PortsWanted(shift int) []string

func (*Manifest) Push

func (m *Manifest) Push(app, registry, tag string, flatten string) []error

func (*Manifest) Raw

func (m *Manifest) Raw() ([]byte, error)

func (*Manifest) Run

func (m *Manifest) Run(app string, cache, sync bool, shift int) []error

func (Manifest) Validate

func (m Manifest) Validate() error

Validate convox-specific convox labels and values for every entry

func (*Manifest) Write

func (m *Manifest) Write(filename string) error

type ManifestEntry

type ManifestEntry struct {
	Build       string      `yaml:"build,omitempty"`
	Dockerfile  string      `yaml:"dockerfile,omitempty"`
	Image       string      `yaml:"image,omitempty"`
	Command     interface{} `yaml:"command,omitempty"`
	Entrypoint  string      `yaml:"entrypoint,omitempty"`
	Environment interface{} `yaml:"environment,omitempty"`
	Labels      interface{} `yaml:"labels,omitempty"`
	Links       []string    `yaml:"links,omitempty"`
	Networks    Networks    `yaml:"networks,omitempty"`
	Ports       interface{} `yaml:"ports,omitempty"`
	Privileged  bool        `yaml:"privileged,omitempty"`
	Volumes     []string    `yaml:"volumes,omitempty"`
}

func (*ManifestEntry) EnvironmentArray

func (me *ManifestEntry) EnvironmentArray() []string

func (ManifestEntry) Label

func (me ManifestEntry) Label(key string) string

func (ManifestEntry) Protocol

func (me ManifestEntry) Protocol(port string) string

func (*ManifestEntry) ResolvedEnvironment

func (me *ManifestEntry) ResolvedEnvironment(m *Manifest, cache bool, app string) ([]string, error)

func (*ManifestEntry) ResolvedLinkVars

func (me *ManifestEntry) ResolvedLinkVars(m *Manifest, cache bool, app string) (map[string]string, error)

NOTE: this is the simpler approach:

build up the ENV from the declared links
assuming local dev is done on DOCKER_HOST

type ManifestV2

type ManifestV2 struct {
	Version  string
	Networks Networks
	Services Manifest
}

type Network

type Network struct {
	Name string
}

type Networks

type Networks map[string]InternalNetwork

type Procfile

type Procfile []ProcfileEntry

type ProcfileEntry

type ProcfileEntry struct {
	Name    string
	Command string
}

type Sync

type Sync struct {
	Container string
	Local     string
	Remote    string
}

type YAMLError

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

YAMLError is an error type to use when the user-supplied manifest YAML is not valid This can be treated as a validation error, not an exception

func (*YAMLError) Error

func (y *YAMLError) Error() string

Jump to

Keyboard shortcuts

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