pluginapi

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MPL-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const IMPLEMENT_ME = "implement me!"
View Source
const (
	PathSeparator = "/"
)

Variables

This section is empty.

Functions

func ConcatFullPipelineName added in v0.0.4

func ConcatFullPipelineName(serviceName, pipelineName string) string

Types

type ApplicationSupport added in v0.0.2

type ApplicationSupport interface {
	basicapi.Application

	GetFileResourceManager(name string) FileResourceManager

	AddConfigureManager(manager basicapi.FullConfigureManager) error
	AddFileResourceManager(fileManager FileResourceManager) error
	AddSubConnectorGeneratorDefinitions(tomlData string) error
	AddSourceConnectorGenerator(source SourceConnectorGenerator) error
	AddTargetConnectorGenerator(target TargetConnectorGenerator) error
	AddApplicationListener(listener LifecycleListener)

	Startup() error
	Stop() error
}

type CommonSourceConnectorGenerateRequest added in v0.0.3

type CommonSourceConnectorGenerateRequest struct {
	Options      map[string]string
	Application  ApplicationSupport
	InstanceName string
}

type CommonTargetConnectorGenerateRequest added in v0.0.3

type CommonTargetConnectorGenerateRequest struct {
	Options      map[string]string
	Application  ApplicationSupport
	InstanceName string
}

type Connector

type Connector interface {
	Start() error
	Stop() error
	Reload() error
}

type Container

type Container interface {
	RegisterBuiltinFn(name string, fnGen FnGen) error
	RegisterCustomFn(name string, fnGen FnGen) error

	NewModel() Model
	WrapReadonlyModelFromMap(map[string]interface{}) (Model, error)

	LoadFlowModel(tomlContent string) error
	LoadMerged(content string) error

	SetupDispatchDecider(decider DispatchDecider) error //TODO Temp solution: container level, due to lifecycle management
	AddLifecycleListener(listener LifecycleListener)
	StartContainer() error
	StopContainer() error
}

type DataType

type DataType int
const (
	DataTypeUnavailable DataType = 0
	DataTypeInt         DataType = 1
	DataTypeString      DataType = 2
	DataTypeBool        DataType = 3
	DataTypeFloat       DataType = 4
	DataTypeArray       DataType = 51
	DataTypeObject      DataType = 52
)

type DispatchDecider added in v0.0.4

type DispatchDecider interface {
	AddFlowInvoker(f FlowInvoker) error

	InjectLocalPipeline(pipelineFullName string, process PipelineProcess) error
	PipelineDispatcher(pipelineFullName string) PipelineProcess

	StartDispatcher() error // triggered once all pipeline resources prepared
	StopDispatcher() error  // triggered once all pipeline resources prepared
}

type FileResourceManager added in v0.0.2

type FileResourceManager interface {
	Name() string
	LoadFile(path string) ([]byte, error)

	Startup() error
	Stop() error
}

FileResourceManager defines file resource accessing provider Note: more functionality may be provided including:

  • http.FileSystem

type FlowError

type FlowError struct {
	Key     string
	Message string
}

func (FlowError) Error

func (f FlowError) Error() string

type FlowInvoker added in v0.0.4

type FlowInvoker interface {
	Metadata() FlowInvokerMeta

	AddPipeline(pipelineName string, process PipelineProcess) error
	Invoke(pipelineFullName string, model Model) error

	StartFlowInvoker() error // controlled by DispatcherDecider
	StopFlowInvoker() error  // controlled by DispatcherDecider
}

type FlowInvokerMeta added in v0.0.4

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

func NewFlowInvokerMeta added in v0.0.4

func NewFlowInvokerMeta(name string, remote bool) FlowInvokerMeta

func (FlowInvokerMeta) Name added in v0.0.4

func (m FlowInvokerMeta) Name() string

func (FlowInvokerMeta) Remote added in v0.0.4

func (m FlowInvokerMeta) Remote() bool

type FlowStop

type FlowStop struct {
	Key     string
	Message string
}

func (FlowStop) Error

func (f FlowStop) Error() string

type Fn

type Fn = basicapi.Fn

type FnGen

type FnGen = basicapi.FnGen

type LifecycleListener added in v0.0.3

type LifecycleListener interface {
	OnStart() error
	OnStop() error
}

type MappingDefinition

type MappingDefinition struct {
	ErrSimple    []map[string]string
	ReqConverter func(src, dst Model) error
	ReqArgPaths  []string
	ResConverter func(src, dst Model) error
	ResArgPaths  []string
}

type Model

type Model = basicapi.Model

type ModelCopy added in v0.0.4

type ModelCopy interface {
	Transfer(dst Model) error
}

type ModelEncoding added in v0.0.4

type ModelEncoding interface {
	ToToml() ([]byte, error)
	FromToml([]byte) error
}

type PipelineProcess

type PipelineProcess func(m Model) error

type SourceConnector

type SourceConnector interface {
	Connector

	BindPipeline(PipelineProcess) error
}

type SourceConnectorGenerateRequest added in v0.0.2

type SourceConnectorGenerateRequest struct {
	CommonSourceConnectorGenerateRequest
	Definition *MappingDefinition
	Container  Container
}

type SourceConnectorGenerator

type SourceConnectorGenerator interface {
	OriginalGeneratorNames() []string
	GenerateSourceConnectorInstance(req SourceConnectorGenerateRequest) (SourceConnector, error)

	InitializeSubGeneratorInstance(req CommonSourceConnectorGenerateRequest) (SourceConnectorGenerator, error)
	Startup() error
	Stop() error
}

type TargetConnector

type TargetConnector interface {
	Connector

	InvokeFlow(s, d Model) error
}

type TargetConnectorGenerateRequest added in v0.0.2

type TargetConnectorGenerateRequest struct {
	CommonTargetConnectorGenerateRequest
	Definition *MappingDefinition
	Container  Container
}

type TargetConnectorGenerator

type TargetConnectorGenerator interface {
	OriginalGeneratorNames() []string
	GenerateTargetConnectorInstance(req TargetConnectorGenerateRequest) (TargetConnector, error)

	InitializeSubGeneratorInstance(req CommonTargetConnectorGenerateRequest) (TargetConnectorGenerator, error)
	Startup() error
	Stop() error
}

type TypeOfNode

type TypeOfNode int
const (
	TypeUnknown       TypeOfNode = 0
	TypeDataNode      TypeOfNode = 1
	TypeNsNode        TypeOfNode = 2
	TypeAttributeNode TypeOfNode = 3
)

Jump to

Keyboard shortcuts

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