modules

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDependencies

func CheckDependencies(module *app.M4DModule, moduleMap map[string]*app.M4DModule) ([]string, []string)

CheckDependencies returns dependent module names

Types

type DataDetails

type DataDetails struct {
	// Name of the asset
	Name string
	// Interface is the protocol and format
	Interface app.InterfaceDetails
	// Geography is the geo-location of the asset
	Geography string
	// Connection is the connection details in raw format as received from the connector
	Connection runtime.RawExtension
	// Metadata
	Metadata *pb.DatasetMetadata
}

DataDetails is the information received from the catalog connector

type DataInfo

type DataInfo struct {
	// Source connection details
	DataDetails *DataDetails
	// Data asset credentials
	Credentials *pb.DatasetCredentials
	// The path to Vault secret which holds the dataset credentials
	VaultSecretPath string
	// Pointer to the relevant data context in the M4D application spec
	Context *app.DataContext
}

DataInfo defines all the information about the given data set that comes from the m4dapplication spec and from the connectors.

type ModuleInstanceSpec

type ModuleInstanceSpec struct {
	Module      *app.M4DModule
	Args        *app.ModuleArguments
	AssetID     string
	ClusterName string
}

ModuleInstanceSpec consists of the module spec and arguments

type Selector

type Selector struct {
	Module       *app.M4DModule
	Dependencies []*app.M4DModule
	Message      string
	Flow         app.ModuleFlow
	Source       *app.InterfaceDetails
	Destination  *app.InterfaceDetails
	// Actions that the module will perform
	Actions []*pb.EnforcementAction
	// Geography where the module will be orchestrated
	Geo string
}

Selector is responsible for finding an appropriate module

func (*Selector) AddModuleInstances

func (m *Selector) AddModuleInstances(args *app.ModuleArguments, item DataInfo, cluster string) []ModuleInstanceSpec

AddModuleInstances creates module instances for the selected module and its dependencies

func (*Selector) GetDependencies

func (m *Selector) GetDependencies() []*app.M4DModule

GetDependencies returns dependencies of a selected module

func (*Selector) GetError

func (m *Selector) GetError() string

GetError returns an error message

func (*Selector) GetModule

func (m *Selector) GetModule() *app.M4DModule

GetModule returns the selected module

func (*Selector) SelectCluster

func (m *Selector) SelectCluster(item DataInfo, clusters []multicluster.Cluster) (string, error)

SelectCluster chooses where the module runs Current logic: Read is done at target (processing geography) Copy is done at source when transformations are required, and at target - otherwise Write is done at target

func (*Selector) SelectModule

func (m *Selector) SelectModule(moduleMap map[string]*app.M4DModule) bool

SelectModule finds the module that fits the requirements

func (*Selector) SupportsDependencies

func (m *Selector) SupportsDependencies(module *app.M4DModule, moduleMap map[string]*app.M4DModule) bool

SupportsDependencies checks whether the module supports the dependency requirements

func (*Selector) SupportsGovernanceAction

func (m *Selector) SupportsGovernanceAction(module *app.M4DModule, action *pb.EnforcementAction) bool

SupportsGovernanceAction checks whether the module supports the required agovernance action

func (*Selector) SupportsGovernanceActions

func (m *Selector) SupportsGovernanceActions(module *app.M4DModule, actions []*pb.EnforcementAction) bool

SupportsGovernanceActions checks whether the module supports the required agovernance actions

func (*Selector) SupportsInterface

func (m *Selector) SupportsInterface(module *app.M4DModule) bool

SupportsInterface indicates whether the module supports interface requirements and dependencies

Jump to

Keyboard shortcuts

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