hooks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package hooks contains a runner that can run hook configured in config file. It uses an abstraction for different executors to make it possible to run different hooks in different executors.

Standard implementation contains an executor for simple commands and scripts. Scripts will use go-getter to download the script and run locally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner that can execute hooks

func New

func New(options *def.Options) *Runner

New creates a new runner for executing hooks.

func (*Runner) Run

func (r *Runner) Run(file *loader.ParsedFile, event, command string) error

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

func (*Runner) ShouldRun

func (r *Runner) ShouldRun(hook *config.Hook, event, command string) bool

ShouldRun checks if the hook should run for event and command sent as input. Returns true if it should continue to process hook, and false otherwise.

Directories

Path Synopsis
Package command implements creator and executor interface to create a command executor that can execute any command line commands.
Package command implements creator and executor interface to create a command executor that can execute any command line commands.
Package def contains definitions / interfaces used across hooks packages.
Package def contains definitions / interfaces used across hooks packages.
Package script contains an execution creator that can download scripts using go-getter and then execute the local script.
Package script contains an execution creator that can download scripts using go-getter and then execute the local script.

Jump to

Keyboard shortcuts

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