procfile

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProcfileName is the name of the Procfile file.
	ProcfileName = "Procfile"
)

Functions

This section is empty.

Types

type CMDExtractor

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

CommandExtractor is an Extractor implementation that returns a Procfile based on the CMD directive in the Dockerfile. It makes the assumption that the cmd is a "web" process.

func NewCMDExtractor

func NewCMDExtractor(c *docker.Client) *CMDExtractor

func (*CMDExtractor) Extract

func (e *CMDExtractor) Extract(img image.Image) (Procfile, error)

type Extractor

type Extractor interface {
	Extract(image.Image) (Procfile, error)
}

Extract represents something that can extract a Procfile from an image.

func MultiExtractor

func MultiExtractor(extractors ...Extractor) Extractor

MultiExtractor is an Extractor implementation that tries multiple Extractors in succession until one succeeds.

type ExtractorFunc

type ExtractorFunc func(image.Image) (Procfile, error)

func (ExtractorFunc) Extract

func (fn ExtractorFunc) Extract(image image.Image) (Procfile, error)

type FileExtractor

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

FileExtractor is an implementation of the Extractor interface that extracts the Procfile from the images WORKDIR.

func NewFileExtractor

func NewFileExtractor(c *docker.Client) *FileExtractor

func (*FileExtractor) Extract

func (e *FileExtractor) Extract(img image.Image) (Procfile, error)

Extract implements Extractor Extract.

type Procfile

type Procfile map[string]string

Procfile is a Go representation of a Procfile, which maps a named process to a command to run.

TODO: This would be better represented as a map[string][]string.

func ParseProcfile

func ParseProcfile(b []byte) (Procfile, error)

ParseProcfile takes a byte slice representing a YAML Procfile and parses it into a Procfile.

type ProcfileError

type ProcfileError struct {
	Err error
}

Example instance: Procfile doesn't exist

func (*ProcfileError) Error

func (e *ProcfileError) Error() string

Jump to

Keyboard shortcuts

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