registry

package
v3.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const BuiltinOrigin = "builtin"

BuiltinOrigin is the origin for Yorc builtin

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionTypeMatch

type ActionTypeMatch struct {
	ActionType string              `json:"action_type"`
	Operator   prov.ActionOperator `json:"-"`
	Origin     string              `json:"origin"`
}

ActionTypeMatch represents a matching between an actionType and an ActionOperator from a given origin

type Definition

type Definition struct {
	Name   string `json:"name"`
	Origin string `json:"origin"`
	Data   []byte `json:"-"`
}

Definition represents a TOSCA definition with its Name, Origin and Data content

type DelegateMatch

type DelegateMatch struct {
	Match    string                `json:"node_type"`
	Executor prov.DelegateExecutor `json:"-"`
	Origin   string                `json:"origin"`
}

DelegateMatch represents a matching between a node type regexp match and a DelegateExecutor from a given origin

type InfraUsageCollector

type InfraUsageCollector struct {
	Name                string                   `json:"id"`
	Origin              string                   `json:"origin"`
	InfraUsageCollector prov.InfraUsageCollector `json:"-"`
}

InfraUsageCollector represents an infrastructure usage collector with its Name, Origin and Data content

type OperationExecMatch

type OperationExecMatch struct {
	Artifact string                 `json:"implementation_artifact"`
	Executor prov.OperationExecutor `json:"-"`
	Origin   string                 `json:"origin"`
}

OperationExecMatch represents a matching between an implementation artifact match and an OperationExecutor from a given origin

type Registry

type Registry interface {
	// RegisterDelegates register a list of node type regexp matches that should be used along with the given
	// prov.DelegateExecutor. Origin is the origin of the executor (builtin for builtin executors or the plugin name in case of a plugin)
	RegisterDelegates(matches []string, executor prov.DelegateExecutor, origin string)
	// Returns the first prov.DelegateExecutor that matches the given nodeType
	//
	// If the given nodeType can't match any prov.DelegateExecutor an error is returned
	GetDelegateExecutor(nodeType string) (prov.DelegateExecutor, error)
	// ListDelegateExecutors returns a map of node types matches to prov.DelegateExecutor origin
	ListDelegateExecutors() []DelegateMatch

	// Register a TOSCA definition file. Origin is the origin of the executor (builtin for builtin executors or the plugin name in case of a plugin)
	AddToscaDefinition(name, origin string, data []byte)
	// GetToscaDefinition retruns the definitions for the given name.
	//
	// If the given definition name can't match any definition an error is returned
	GetToscaDefinition(name string) ([]byte, error)
	// ListToscaDefinitions returns a map of definitions names to their origin
	ListToscaDefinitions() []Definition

	// RegisterOperationExecutor register a list of implementation artifact type that should be used along with the given
	// prov.OperationExecutor. Origin is the origin of the executor (builtin for builtin executors or the plugin name in case of a plugin)
	RegisterOperationExecutor(artifacts []string, executor prov.OperationExecutor, origin string)
	// Returns the first prov.OperationExecutor that matches the given artifact implementation
	//
	// If the given nodeType can't match any prov.DelegateExecutor an error is returned
	GetOperationExecutor(artifact string) (prov.OperationExecutor, error)
	// ListOperationExecutors returns a map of node types matches to prov.DelegateExecutor origin
	ListOperationExecutors() []OperationExecMatch

	// Register a Vault Client Builder. Origin is the origin of the client builder (builtin for builtin vault client builder or the plugin name in case of a plugin)
	RegisterVaultClientBuilder(id string, builder vault.ClientBuilder, origin string)
	// Returns the first vault.ClientBuilder that matches the given id
	//
	// If the given id can't match any vault.ClientBuilder an error is returned
	GetVaultClientBuilder(id string) (vault.ClientBuilder, error)

	// ListVaultClients returns a list of registered Vault Clients origin
	ListVaultClientBuilders() []VaultClientBuilder

	// RegisterInfraUsageCollector allows to register an infrastructure usage collector with its name as unique id
	RegisterInfraUsageCollector(name string, infraUsageCollector prov.InfraUsageCollector, origin string)

	// GetInfraUsageCollector returns a prov.Infrastructure from its name as unique id
	//
	// If the given id can't match any prov.Infrastructure an error is returned
	GetInfraUsageCollector(name string) (prov.InfraUsageCollector, error)

	// ListInfraUsageCollectors returns a list of registered infrastructure usage collectors origin
	ListInfraUsageCollectors() []InfraUsageCollector

	// RegisterActionOperator register a list of actionTypes that should be used along with the given
	// prov.ActionOperator. Origin is the origin of the operator (builtin for builtin operators or the plugin name in case of a plugin)
	RegisterActionOperator(actionTypes []string, operator prov.ActionOperator, origin string)
	// Returns the first prov.ActionOperator that matches the given actionType
	//
	// If the given actionType can't match any prov.ActionOperator, an error is returned
	GetActionOperator(actionType string) (prov.ActionOperator, error)
	// ListActionOperators returns a map of actionTypes matches to prov.ActionOperator origin
	ListActionOperators() []ActionTypeMatch
}

Registry holds references to for node types matches to prov.DelegateExecutor

func GetRegistry

func GetRegistry() Registry

GetRegistry returns the singleton instance of the Registry

type VaultClientBuilder

type VaultClientBuilder struct {
	ID      string              `json:"id"`
	Origin  string              `json:"origin"`
	Builder vault.ClientBuilder `json:"-"`
}

VaultClientBuilder represents a vault client builder with its ID, Origin and Data content

Jump to

Keyboard shortcuts

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