definition

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StepTypes = map[string]bool{
	"stage":     true,
	"container": true,
	"command":   true,
	"export":    true,
}

StepTypes - Defines step types

Functions

This section is empty.

Types

type CorkTemplateRenderer

type CorkTemplateRenderer struct {
	Outputs     map[string]map[string]string
	FuncMap     template.FuncMap
	WorkDir     string
	HostWorkDir string
	CacheDir    string
}

func NewTemplateRenderer

func NewTemplateRenderer() *CorkTemplateRenderer

func NewTemplateRendererWithOptions

func NewTemplateRendererWithOptions(options CorkTemplateRendererOptions) *CorkTemplateRenderer

func (*CorkTemplateRenderer) AddOutput

func (c *CorkTemplateRenderer) AddOutput(stepName string, varName string, value string)

func (*CorkTemplateRenderer) Render

func (c *CorkTemplateRenderer) Render(templateStr string) (string, error)

type CorkTemplateRendererOptions

type CorkTemplateRendererOptions struct {
	WorkDir     string
	HostWorkDir string
	CacheDir    string
}

type Empty

type Empty struct {
}

type Export

type Export struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

Export - used for export variable definition

type ServerDefinition

type ServerDefinition struct {
	Stages  map[string]Stage `yaml:"stages"`
	Volumes Volumes          `yaml:"volumes"`
	Tags    []string         `yaml:"tags"`
	Version int              `yaml:"version"`
}

ServerDefinition - Defines a cork server

func LoadFromBytes

func LoadFromBytes(defBytes []byte) (*ServerDefinition, error)

LoadFromBytes - Loads the server definition from bytes

func LoadFromDir

func LoadFromDir(corkDir string) (*ServerDefinition, error)

Load - Loads the server definition from the default location

func LoadFromPath

func LoadFromPath(defPath string) (*ServerDefinition, error)

LoadFromPath - Loads the server definition from the specified path

func LoadFromString

func LoadFromString(defStr string) (*ServerDefinition, error)

LoadFromString - Loads the server definition from a string

func (*ServerDefinition) ListSteps

func (sd *ServerDefinition) ListSteps(stageName string) ([]*Step, error)

ListSteps - Traverses the steps of a stage and resolves everything to a step

func (*ServerDefinition) Validate

func (sd *ServerDefinition) Validate() error

Validate - Validates a definition file

type Stage

type Stage []*Step

Stage - Defines a stage

type Step

type Step struct {
	Type      string   `yaml:"type"`
	Name      string   `yaml:"name,omitempty"`
	Args      StepArgs `yaml:"args,omitempty"`
	MatchTags []string `yaml:"match_tags,omitempty"`
	SkipTags  []string `yaml:"skip_tags,omitempty"`
	Outputs   []string `yaml:"outputs,omitempty"`
}

Step - Defines a step

type StepArgs

type StepArgs struct {
	Image   string            `yaml:"image,omitempty"`
	Command string            `yaml:"command,omitempty"`
	Stage   string            `yaml:"stage,omitempty"`
	Params  map[string]string `yaml:"params,omitempty"`
	Export  Export            `yaml:"export,omitempty"`
}

StepArgs - Defines a step's arguments

func (*StepArgs) ResolveArgs

func (sa *StepArgs) ResolveArgs(renderer *CorkTemplateRenderer) (*StepArgs, error)

type TemplateRenderer

type TemplateRenderer interface {
	Render(templateStr string)
}

TemplateRenderer - Interface to user for the template rendering

type Volumes

type Volumes struct {
	Names  []string `yaml:"names"`
	Mounts []string `yaml:"mounts"`
}

Jump to

Keyboard shortcuts

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