plugin

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

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".

PostProcess plugins has access to all data across all cloud providers and executed as a last step.

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

Index

Constants

This section is empty.

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

type CodePlugin interface {
	Base

	Create(deployName string, params util.NestedParameterMap, eventLog *event.Log) error
	Update(deployName string, params util.NestedParameterMap, eventLog *event.Log) error
	Destroy(deployName string, params util.NestedParameterMap, eventLog *event.Log) error
	Endpoints(deployName string, params util.NestedParameterMap, eventLog *event.Log) (map[string]string, error)
}

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 PostProcessPlugin

type PostProcessPlugin interface {
	Base

	Process(desiredPolicy *lang.Policy, desiredState *resolve.PolicyResolution, externalData *external.Data, eventLog *event.Log) error
}

PostProcessPlugin is a definition of post-processing plugin which gets called once by an action from the engine applier, after engine is done processing all component instances.

type Registry

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

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, postProcessPlugins []PostProcessPlugin) 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

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