trigger

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package trigger provides functionality that help manipulate stacks triggers.

Index

Constants

View Source
const (
	// ErrTrigger indicates an error happened while triggering the stack.
	ErrTrigger errors.Kind = "trigger failed"

	// ErrParsing indicates an error happened while parsing the trigger file.
	ErrParsing errors.Kind = "parsing trigger file"
)
View Source
const (
	// DefaultType is the default trigger type when not specified.
	DefaultType = "changed"

	// DefaultContext is the default context for the trigger file when not
	// specified.
	DefaultContext = "stack"
)

Variables

This section is empty.

Functions

func Create

func Create(root *config.Root, path project.Path, reason string) error

Create creates a trigger for a stack with the given path and the given reason inside the project rootdir.

func Dir

func Dir(rootdir string) string

Dir will return the triggers directory for the project rooted at rootdir. Both rootdir and the returned value are host absolute paths.

func StackPath

func StackPath(triggerFile project.Path) (project.Path, bool)

StackPath accepts a trigger file path and returns the path of the stack that is triggered by the given file. If the given file is not a stack trigger at all it will return false.

Types

type Info

type Info struct {
	// Ctime is unix timestamp of when the trigger was created.
	Ctime int64
	// Reason is the reason why the trigger was created, if any.
	Reason string
	// Type is the trigger type.
	Type string
	// Context is the context of the trigger (only `stack` at the moment)
	Context string
}

Info represents the parsed contents of a trigger for triggers created by Terramate.

func ParseFile

func ParseFile(path string) (Info, error)

ParseFile will parse the given trigger file.

Jump to

Keyboard shortcuts

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