definitions

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2020 Fugue, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Fugue, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Fugue, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020 Fugue, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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 Condition added in v0.3.0

type Condition struct {
	ResourceExists  string          `yaml:"resource_exists"`
	DirectoryExists string          `yaml:"directory_exists"`
	ScriptSucceeds  ConditionScript `yaml:"script_succeeds"`
}

Condition that controls rule or command execution

type ConditionScript added in v0.3.0

type ConditionScript struct {
	Run           string `yaml:"run"`
	WithOutput    string `yaml:"with_output"`
	SuppressError bool   `yaml:"suppress_error"`
}

ConditionScript defines a script to be used to check a Condition

func (ConditionScript) IsEmpty added in v0.3.0

func (s ConditionScript) IsEmpty() bool

IsEmpty returns true if the Script is not defined

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"`
	When        Condition     `yaml:"when"`
	Unless      Condition     `yaml:"unless"`
}

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