definitions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Kind       string
	Argument   string
	Attributes map[string]interface{}
}

Command to execute within a rule

func GetCommand added in v0.2.0

func GetCommand(obj interface{}) (*Command, error)

GetCommand returns one command from its semi-structured YAML form

type Component

type Component struct {
	Name        string            `yaml:"name"`
	App         string            `yaml:"app"`
	Kind        string            `yaml:"kind"`
	Ignore      bool              `yaml:"ignore"`
	Docker      Docker            `yaml:"docker"`
	ECS         ECS               `yaml:"ecs"`
	Toolchain   Toolchain         `yaml:"toolchain"`
	Rules       map[string]Rule   `yaml:"rules"`
	Exports     map[string]Export `yaml:"exports"`
	Environment map[string]string `yaml:"environment"`
	Path        string
}

Component defines component configuration in YAML

func LoadComponent

func LoadComponent(text []byte) (*Component, error)

LoadComponent loads a definition from the given text

func LoadComponentFromPath

func LoadComponentFromPath(path string) (*Component, error)

LoadComponentFromPath loads a definition from the specified file

func (*Component) Merge

func (c *Component) Merge(other *Component) *Component

Merge one Component defintion with another. Both original defintions remain unmodified and a new Component definition is returned.

type Dependency

type Dependency struct {
	Component string `yaml:"component"`
	Rule      string `yaml:"rule"`
	Export    string `yaml:"export"`
	Recurse   int    `yaml:"recurse"`
}

Dependency between Rules

type Docker

type Docker struct {
	Image string `yaml:"image"`
}

Docker defines Docker configuration for a component

type ECS

type ECS struct {
	Task   string `yaml:"task"`
	Type   string `yaml:"type"`
	Memory int    `yaml:"memory"`
	CPU    int    `yaml:"cpu"`
}

ECS defines ECS configuration for a component

type Export

type Export struct {
	Provider  string   `yaml:"provider"`
	Resources []string `yaml:"resources"`
	Ignore    []string `yaml:"ignore"`
}

Export defines resources exposed by a Component

type Project

type Project struct {
	Name        string                            `yaml:"name"`
	Environment map[string]string                 `yaml:"environment"`
	Components  []string                          `yaml:"components"`
	Providers   map[string]map[string]interface{} `yaml:"providers"`
}

Project defines project configuration in YAML

func LoadProject

func LoadProject(text []byte) (*Project, error)

LoadProject loads a definition from the given text

func LoadProjectFromPath

func LoadProjectFromPath(path string) (*Project, error)

LoadProjectFromPath loads a definition from the specified file

type Providers

type Providers struct {
	Inputs  string `yaml:"inputs"`
	Outputs string `yaml:"outputs"`
}

Providers specifies the name of the Provider type to be used for the input and output Resources of a Rule

type Rule

type Rule struct {
	Name        string        `yaml:"name"`
	Inputs      []string      `yaml:"inputs"`
	Outputs     []string      `yaml:"outputs"`
	Ignore      []string      `yaml:"ignore"`
	Local       bool          `yaml:"local"`
	Native      bool          `yaml:"native"`
	Requires    []Dependency  `yaml:"requires"`
	Description string        `yaml:"description"`
	Command     string        `yaml:"command"`
	Commands    []interface{} `yaml:"commands"`
	Providers   Providers     `yaml:"providers"`
}

Rule defines inputs, commands, and outputs for a build step or action

func (Rule) GetCommands added in v0.2.0

func (r Rule) GetCommands() (result []*Command, err error)

GetCommands returns commands unmarshaled from the rule's semi-structured YAML

type Toolchain

type Toolchain struct {
	Items []ToolchainItem `yaml:"items"`
}

Toolchain identifies dependencies this component has on build tools. This may be used to identify changes in toolchain that may necessitate a rebuild.

type ToolchainItem

type ToolchainItem struct {
	Name    string `yaml:"name"`
	Command string `yaml:"command"`
}

ToolchainItem is one part of a Component Toolchain

Jump to

Keyboard shortcuts

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