Documentation ¶
Overview ¶
Package plugin content relative to the package
Index ¶
- Constants
- Variables
- func ExecutePlugin(ctx execution.FeatureContext, plugin *Base, fn ExecuteFn) errors.Error
- func IsPluginBaseArgument(name string) bool
- func IsPluginBaseBlock(name string) bool
- func SetBaseArgs(plugin Plugin, attribute *hcl.Attribute) errors.Error
- func SetBaseBlock(plugin Plugin, blockType string, blocks hcl.Blocks) errors.Error
- type Base
- func (s *Base) AddBlockUse(entry *use.Use)
- func (s *Base) Description() string
- func (s *Base) ExtraAValues() map[string]cty.Value
- func (s *Base) PopulateValuesWithExtraValues(ctx *hcl.EvalContext) errors.Error
- func (s *Base) SetCount(count hcl.Expression)
- func (s *Base) SetDesc(desc string)
- func (s *Base) SetKind(kind string)
- func (s *Base) SetWhen(when hcl.Expression)
- func (s *Base) SetWhile(while hcl.Expression)
- func (s *Base) String() string
- type BaseInterface
- type ExecuteFn
- type Plugin
- type Plugins
Constants ¶
const ( // ArgDesc contains the name of the argument used in the plugins block. ArgDesc = "_desc" // ArgWhen contains the name of the argument used in the plugins block. ArgWhen = "when" // ArgWhile contains the name of the argument used in the plugins block. ArgWhile = "while" // ArgCount contains the name of the argument used in the plugins block. ArgCount = "count" )
Variables ¶
var BaseArguments = []hcl.AttributeSchema{ {Name: ArgDesc, Required: false}, {Name: ArgWhen, Required: false}, {Name: ArgWhile, Required: false}, {Name: ArgCount, Required: false}, }
BaseArguments contain the list of common attributes.
var BaseBlocks = []hcl.BlockHeaderSchema{ { Type: use.BlockUse, LabelNames: []string{use.ArgRef}, }, }
BaseBlocks contains block definitions for plugins.
Functions ¶
func ExecutePlugin ¶
ExecutePlugin Given a plugin and the context is executed.
func IsPluginBaseArgument ¶
IsPluginBaseArgument returns true if the name is common for all the plugins.
func IsPluginBaseBlock ¶
IsPluginBaseBlock return true if the block is a common block.
func SetBaseArgs ¶
SetBaseArgs set the common arguments.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base contain the common attributes of all the plugins.
func (*Base) Description ¶
Description return block description.
func (*Base) ExtraAValues ¶
ExtraAValues return inherited values.
func (*Base) PopulateValuesWithExtraValues ¶
PopulateValuesWithExtraValues populate the common attributes.
type BaseInterface ¶
type BaseInterface interface { SetDesc(string) SetWhen(hcl.Expression) SetWhile(hcl.Expression) SetKind(string) String() string Description() string AddBlockUse(use *use.Use) SetCount(hcl.Expression) PopulateValuesWithExtraValues(*hcl.EvalContext) errors.Error }
BaseInterface contains common methods to be implemented by any interface.
type ExecuteFn ¶
type ExecuteFn func(ctx execution.FeatureContext) errors.Error
ExecuteFn defined type to be implemented by the plugins.
type Plugin ¶
type Plugin interface { BaseInterface Execute(ctx execution.FeatureContext) errors.Error }
Plugin interface to be implemented by any plugin.
Directories ¶
Path | Synopsis |
---|---|
Package use contains types and methods to deal with block use
|
Package use contains types and methods to deal with block use |