plugin

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 6 Imported by: 27

Documentation

Overview

Package plugin introduces plugins for Aptomi engine such as cluster (kubernetes) and code (helm) plugins.

Cluster plugins responsible for working with different cloud providers, such as kubernetes. Separated instance of the cluster plugins is created for each lang.Cluster, so, it could safely cache data.

Code plugins responsible for handling deployment into the cloud providers, such as helm. Separated instance of the code plugin is created for each pair of the lang.Cluster and code type, for example, cluster "test-1" and code type "helm".

All plugins created for single enforcement cycle or API call using plugin registry.

Index

Constants

View Source
const ParamTargetSuffix = "target-suffix"

ParamTargetSuffix it's a plugin-specific parameter, which is additionally specifies where the code should reside (in case of k8s and Helm, it's a string consisting of k8s namespace)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base added in v0.1.11

type Base interface {
	Cleanup() error
}

Base is a base interface for all engine plugins

type ClusterPlugin added in v0.1.11

type ClusterPlugin interface {
	Base

	Validate() error
}

ClusterPlugin is a definition of cluster plugin which takes care of cluster operations such as validation in the cloud. It's created for specific cluster and enforcement cycle or API call.

type ClusterPluginConstructor added in v0.1.11

type ClusterPluginConstructor func(cluster *lang.Cluster, cfg config.Plugins) (ClusterPlugin, error)

ClusterPluginConstructor represents constructor for the cluster plugin

type CodePlugin added in v0.1.11

CodePlugin is a definition of deployment plugin which takes care of creating, updating and destroying component instances in the cloud. It's created for specific cluster and enforcement cycle or API call.

type CodePluginConstructor added in v0.1.11

type CodePluginConstructor func(cluster ClusterPlugin, cfg config.Plugins) (CodePlugin, error)

CodePluginConstructor represents constructor the the code plugin

type CodePluginInvocationParams added in v0.1.15

type CodePluginInvocationParams struct {
	DeployName   string
	Params       util.NestedParameterMap
	PluginParams map[string]string
	EventLog     *event.Log
}

CodePluginInvocationParams is a struct that will be passed into CodePlugin when invoking its methods

type Registry

type Registry interface {
	ForCluster(cluster *lang.Cluster) (ClusterPlugin, error)
	ForCodeType(cluster *lang.Cluster, codeType string) (CodePlugin, error)
}

Registry is a registry of all Aptomi engine plugins

func NewRegistry

func NewRegistry(config config.Plugins, clusterTypes map[string]ClusterPluginConstructor, codeTypes map[string]map[string]CodePluginConstructor) Registry

NewRegistry creates a registry of aptomi engine plugins

type RegistryFactory added in v0.1.10

type RegistryFactory func() Registry

RegistryFactory returns plugins registry on demand

type Resource added in v0.1.12

type Resource = []string

Resource is a list of columns representing deployed resources

type ResourceRegistry added in v0.1.12

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

ResourceRegistry helps to store and use handlers and headers for resources

func NewResourceRegistry added in v0.1.12

func NewResourceRegistry() *ResourceRegistry

NewResourceRegistry creates new ResourceRegistry

func (*ResourceRegistry) AddHandler added in v0.1.12

func (reg *ResourceRegistry) AddHandler(resourceType string, headers []string, handler ResourceTypeHandler)

AddHandler adds specified resource type handler to registry by specified resource type with specified headers

func (*ResourceRegistry) Handle added in v0.1.12

func (reg *ResourceRegistry) Handle(resourceType string, obj interface{}) []string

Handle returns columns for specified object with specified resource type

func (*ResourceRegistry) Headers added in v0.1.12

func (reg *ResourceRegistry) Headers(resourceType string) []string

Headers returns headers for specified resource type

func (*ResourceRegistry) IsSupported added in v0.1.12

func (reg *ResourceRegistry) IsSupported(resourceType string) bool

IsSupported checks if specified resource type supported by registry

type ResourceTable added in v0.1.12

type ResourceTable struct {
	Headers []string
	Items   []Resource
}

ResourceTable is a list of resources of the same type as columns with column headers

type ResourceTypeHandler added in v0.1.12

type ResourceTypeHandler func(obj interface{}) []string

ResourceTypeHandler represents function that converts object into columns

type Resources added in v0.1.12

type Resources map[string]*ResourceTable

Resources represents description of all deployed on a cluster resources of different types

func (Resources) Merge added in v0.1.12

func (status Resources) Merge(with Resources)

Merge takes Resources and merges them into current resources object

Directories

Path Synopsis
Package helm implements support for Helm plugin, which can deploy Helm charts onto k8s clusters via Helm API.
Package helm implements support for Helm plugin, which can deploy Helm charts onto k8s clusters via Helm API.

Jump to

Keyboard shortcuts

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