component

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MPL-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package component exposes the component interfaces

Index

Constants

This section is empty.

Variables

View Source
var TypeMap = map[Type]interface{}{
	PipelineType: (*PipelinePlugin)(nil),
	MetadataType: (*MetadataPlugin)(nil),
}

TypeMap is a mapping of Type to the nil pointer to the interface of that type. This can be used with libraries such as mapper.

Functions

This section is empty.

Types

type MetadataPlugin

type MetadataPlugin interface {
	PluginMetadata(ctx context.Context) (*PluginMetadata, error)
}

MetadataPlugin is a plugin that provides metadata

type PipelinePlugin

type PipelinePlugin interface {
	ActionInput(ctx context.Context, actionName string) (interface{}, error)
	ActionOutput(ctx context.Context, actionName string) (interface{}, error)
	ExecuteAction(ctx context.Context, input *PipelinePluginActionInput, evalCtx *hcl.EvalContext) interface{}
	Shutdown(ctx context.Context) error
	Config(ctx context.Context) (interface{}, error)
	ConfigSet(ctx context.Context, config interface{}) error
	Schema(ctx context.Context) (*PipelinePluginSchema, error)
}

PipelinePlugin represents a pipeline plugin

type PipelinePluginActionInput

type PipelinePluginActionInput struct {
	InputData  hcl.Body
	ActionName string
}

PipelinePluginActionInput is the input for executing an action

type PipelinePluginActionResponse

type PipelinePluginActionResponse interface {
	Outputs() map[string]cty.Value
}

PipelinePluginActionResponse is the response after execution an action

type PipelinePluginActionSchema

type PipelinePluginActionSchema struct {
	Input       *SchemaBlock                `json:"input"`
	Outputs     map[string]*SchemaAttribute `json:"outputs,omitempty"`
	Name        string                      `json:"name"`
	Description string                      `json:"description"`
	Group       string                      `json:"group"`
	Deprecated  bool                        `json:"deprecated"`
}

PipelinePluginActionSchema represents a single action in a pipeline plugin schema

type PipelinePluginSchema

type PipelinePluginSchema struct {
	Config  *SchemaBlock                           `json:"config"`
	Actions map[string]*PipelinePluginActionSchema `json:"actions"`
}

PipelinePluginSchema represents the schema of a pipeline plugin

type PluginMetadata

type PluginMetadata struct {
	Description string `json:"description"`
}

PluginMetadata is the metadata for a plugin

type SchemaAttribute

type SchemaAttribute struct {
	Name             string                      `json:"name"`
	Description      string                      `json:"description"`
	Type             cty.Type                    `json:"type"`
	Deprecated       bool                        `json:"deprecated"`
	NestedAttributes map[string]*SchemaAttribute `json:"nested_attributes"`
	Required         *bool                       `json:"required,omitempty"`
}

SchemaAttribute represents a single attribute in a schema

type SchemaBlock

type SchemaBlock struct {
	Attributes map[string]*SchemaAttribute `json:"attributes"`
	BlockSpecs map[string]*SchemaBlockSpec `json:"block_specs"`
}

SchemaBlock represents a single HCL block in a schema

type SchemaBlockSpec

type SchemaBlockSpec struct {
	Name        string       `json:"name"`
	Type        cty.Type     `json:"type"`
	Description string       `json:"description"`
	Deprecated  bool         `json:"deprecated"`
	Required    bool         `json:"required"`
	Block       *SchemaBlock `json:"block"`
}

SchemaBlockSpec represents an HCL block field

type Type

type Type uint

Type is an enum of all the types of components supported. This isn't used directly in this package but is used by other packages to reference the component types.

const (
	InvalidType  Type = iota // Invalid
	MetadataType             // Metadata
	PipelineType             // Pipeline

)

Type enum constants

func (Type) String

func (i Type) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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