spacefile

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFilename = ".spacefile.hcl"
View Source
const SpacefileTemplate = `` /* 1284-byte string literal not displayed */

Variables

This section is empty.

Functions

func Generate

func Generate(teamName string, spaceName string, spaceDNSLabel string, software *software.Software, out io.Writer) error

Types

type CommandCronjobDef added in v1.1.0

type CommandCronjobDef struct {
	Command          string   `hcl:"command"`
	Arguments        []string `hcl:"arguments"`
	WorkingDirectory string   `hcl:"workingDirectory"`
}

type CronjobDef added in v1.1.0

type CronjobDef struct {
	Identifier    string             `hcl:",key"`
	Schedule      string             `hcl:"schedule"`
	AllowParallel bool               `hcl:"allowParallel"`
	Command       *CommandCronjobDef `hcl:"command"`
	Timezone      string             `hcl:"timezone"`
}

func (CronjobDef) ToDeclaration added in v1.1.0

func (c CronjobDef) ToDeclaration() (spaces.Cronjob, error)

type CronjobDefList added in v1.1.0

type CronjobDefList []CronjobDef

type ErrSpacefileNotFound

type ErrSpacefileNotFound struct {
	Path string
}

func (ErrSpacefileNotFound) Error

func (n ErrSpacefileNotFound) Error() string

type SoftwareDef

type SoftwareDef struct {
	Identifier string      `hcl:",key"`
	Version    string      `hcl:"version"`
	UserData   interface{} `hcl:"userData"`
}

type SoftwareDefList added in v1.1.0

type SoftwareDefList []SoftwareDef

func (SoftwareDefList) Merge added in v1.1.0

type SpaceDef

type SpaceDef struct {
	DNSLabel string     `hcl:",key"`
	Name     string     `hcl:"name"`
	TeamID   string     `hcl:"team"`
	Stages   []StageDef `hcl:"stage"`
	// contains filtered or unexported fields
}

func (*SpaceDef) ToSpaceDeclaration

func (s *SpaceDef) ToSpaceDeclaration() (*spaces.SpaceDeclaration, error)

ToSpaceDeclaration converts the SpaceDef object used in the Spacefile to a SpaceDeclaration used for the Spaces API calls

func (*SpaceDef) Validate

func (d *SpaceDef) Validate() error

type Spacefile

type Spacefile struct {
	Version string     `hcl:"version"`
	Spaces  []SpaceDef `hcl:"space"`
}

func ParseSpacefile

func ParseSpacefile(filename string) (*Spacefile, error)

func (*Spacefile) Validate

func (f *Spacefile) Validate() error

type StageDef

type StageDef struct {
	Name         string          `hcl:",key"`
	Inherit      string          `hcl:"inherit"`
	Applications SoftwareDefList `hcl:"application"`
	Databases    SoftwareDefList `hcl:"database"`
	Cronjobs     CronjobDefList  `hcl:"cron"`
	// contains filtered or unexported fields
}

func (*StageDef) Application added in v1.1.0

func (d *StageDef) Application() *SoftwareDef

Application returns a reference to the one application defined for this stage

func (*StageDef) Validate

func (d *StageDef) Validate() error

type SyntaxError

type SyntaxError struct {
	File  string
	Inner error
}

func (SyntaxError) Error

func (s SyntaxError) Error() string

Jump to

Keyboard shortcuts

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