plugins

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailablePlugins

func AvailablePlugins() []string

AvailablePlugins searches the plugin directories and returns names of each plugin found.

func RunIfEnabled

func RunIfEnabled(pluginName string, inputsMap, resultsMap *map[string]cty.Value, resultsListMap *map[string][]cty.Value) bool

RunIfEnabled takes the name of a plugin, a map of inputs, and an empty map for results, and will run the plugin if its inputs map does not contain plugin_enabled == "false".

Types

type OutputPlugin

type OutputPlugin interface {
	// Run(inputsMap)
	Run(*map[string]*map[string]cty.Value, *OutputsResults)
}

OutputPlugin is an interface for each Plugin to implement. All this includes is a single function, "Run(*map[string]string, *map[string]string)" which takes a map of inputs and an empty map of outputs that the Plugin is expected to populate

type OutputResults

type OutputResults struct {
	XML  string
	JSON string
}

OutputResults holds XML and JSON string representations of a plugin's outputs

type OutputsResults

type OutputsResults struct {
	Results map[string]OutputResults
	AllXML  string
	AllJSON string
}

OutputsResults holds XML and JSON string representations of the combined plugin's outputs as well as a map of the XML/JSON string representations of individual plugins' outputs

func RunOutputsPlugin

func RunOutputsPlugin(inputsMap *map[string]*map[string]cty.Value) OutputsResults

RunOutputsPlugin takes a map of inputs, runs the "outputs" plugin, and returns JSON/XML string representations of the inputs.

type Plugin

type Plugin interface {
	// Run(inputsMap, resultsMap)
	Run(*map[string]cty.Value, *map[string]cty.Value)
}

Plugin is an interface for each Plugin to implement. All this includes is a single function, "Run(*map[string]string, *map[string]string)" which takes a map of inputs and an empty map of outputs that the Plugin is expected to populate

Jump to

Keyboard shortcuts

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