hoistyml

package
v0.0.0-...-4b435ec Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const FileName = "hoist.yml"

FileName for the hoist.yml file.

Variables

View Source
var (
	ErrUnableToReadFile  = erk.New(ErkUnableToReadFile{}, "cannot read '{{.path}}'; make sure you are in the correct directory")
	ErrUnableToUnmarshal = erk.New(ErkUnableToReadFile{}, "cannot unmarshal '{{.path}}' into the hoist.yml format: {{.err}}")
)
View Source
var (
	ErrVersionRequired    = erk.New(ErkInvalidVersion{}, "hoist.yml 'version' is required")
	ErrVersionUnsupported = erk.New(ErkUnsupportedVersion{}, "only hoist.yml version 0.1.0 is supported, got '{{.version}}'")

	ErrStackMissingName = erk.New(ErkInvalidStack{}, "hoist.yml 'stack' missing 'name'")
	ErrStackNameInvalid = erk.New(ErkInvalidStack{}, "hoist.yml stack name, '{{.name}}', invalid; it can only contain a-z, 0-9, and '-'")

	ErrServiceNameInvalid = erk.New(ErkInvalidService{}, "service name '{{.name}}' is invalid; it can only contain a-z, 0-9, and '-'")
	ErrServiceMissingType = erk.New(ErkInvalidService{}, "service '{{.name}}' missing 'type'")
	ErrServiceMissingPath = erk.New(ErkInvalidService{}, "service '{{.name}}' missing 'path' (use '.' for same directory)")
)

Functions

This section is empty.

Types

type ErkInvalidService

type ErkInvalidService struct{ erks.Default }

type ErkInvalidServices

type ErkInvalidServices struct{ erks.Default }

type ErkInvalidStack

type ErkInvalidStack struct{ erks.Default }

type ErkInvalidVersion

type ErkInvalidVersion struct{ erks.Default }

type ErkUnableToReadFile

type ErkUnableToReadFile struct{ erks.Default }

type ErkUnableToUnmarshal

type ErkUnableToUnmarshal struct{ erks.Default }

type ErkUnsupportedVersion

type ErkUnsupportedVersion struct{ erks.Default }

type Service

type Service struct {
	Name string `yaml:"-"` // Added by Services.Parse()
	Type string `yaml:"type"`
	Path string `yaml:"path"`
}

Service in the Hoist stack.

func (*Service) Parse

func (s *Service) Parse() error

Parse the service and check for errors.

type Services

type Services map[string]*Service

Services in the Hoist stack.

func (Services) Parse

func (s Services) Parse() error

Parse the services and check for errors.

type Stack

type Stack struct {
	Name string `yaml:"name"`
}

Stack details.

func (*Stack) Parse

func (s *Stack) Parse() error

Parse the stack and check for errors.

type Template

type Template struct {
	Version  string   `yaml:"version"`
	Stack    Stack    `yaml:"stack"`
	Services Services `yaml:"services"`
}

Template for the hoist.yml format.

func Load

func Load(fs afero.Fs, dir string) (*Template, error)

Load the hoist.yml file from the provided file system in the given directory.

func (*Template) Parse

func (t *Template) Parse() error

Parse the template and check for errors.

func (*Template) String

func (t *Template) String() string

String representation of the template in YAML.

Jump to

Keyboard shortcuts

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