hooks

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(source *config.Source, event string, command string) error

Run all hooks in source for a specfic event. Command input can filter hooks that should only be run got specific terraform commands.

Types

type Command

type Command struct {
	Hook   *config.Hook
	HasRun bool
	Output map[string]string
	// contains filtered or unexported fields
}

Command is an internal representation of a hook command. Used to execute the hook

func GetCommand

func GetCommand(source *config.Source, hook *config.Hook) *Command

GetCommand creates a new command or return command from cache if it has already been created before. Cache key is based on full path for command including arguments

func (*Command) Run

func (c *Command) Run() error

Run the command hook and parse output

func (*Command) ShouldRun

func (c *Command) ShouldRun(event string, command string) bool

ShouldRun checks if for a given event and command this Command should run

Jump to

Keyboard shortcuts

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