runpluginutil

package
v0.0.0-...-7638cb1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package runpluginutil provides interfaces for running plugins that can be referenced by other plugins and a utility method for parsing documents

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoReply

func NoReply(messageID string, pluginID string, results map[string]*contracts.PluginResult)

func NoUpdate

func NoUpdate(log log.T, documentID string, documentCreatedDate string, pluginOutputs map[string]*contracts.PluginResult, totalNumberOfPlugins int)

func ParseDocument

func ParseDocument(context context.T, documentRaw []byte, orchestrationDir string, s3Bucket string, s3KeyPrefix string, messageID string, documentID string, defaultWorkingDirectory string) (pluginsInfo []model.PluginState, err error)

TODO:MF: Factor out the Configuration processing in processor_state and re-use here

Types

type PluginRegistry

type PluginRegistry map[string]T

PluginRegistry stores a set of plugins (both worker and long running plugins), indexed by ID.

type PluginRunner

type PluginRunner struct {
	RunPlugins func(
		context context.T,
		documentID string,
		documentCreatedDate string,
		plugins []model.PluginState,
		pluginRegistry PluginRegistry,
		sendReply SendResponse,
		updateAssoc UpdateAssociation,
		cancelFlag task.CancelFlag,
	) (pluginOutputs map[string]*contracts.PluginResult)
	Plugins     PluginRegistry
	SendReply   SendResponse
	UpdateAssoc UpdateAssociation
	CancelFlag  task.CancelFlag
}

func (*PluginRunner) ExecuteDocument

func (r *PluginRunner) ExecuteDocument(context context.T, pluginInput []model.PluginState, documentID string, documentCreatedDate string) (pluginOutputs map[string]*contracts.PluginResult)

type SendDocumentLevelResponse

type SendDocumentLevelResponse func(messageID string, resultStatus contracts.ResultStatus, documentTraceOutput string)

SendDocumentLevelResponse is used to send status response before plugin begins

type SendResponse

type SendResponse func(messageID string, pluginID string, results map[string]*contracts.PluginResult)

SendResponse is used to send response on plugin completion. If pluginID is empty it will send responses of all plugins. If pluginID is specified, response will be sent of that particular plugin.

type T

type T interface {
	Execute(context context.T, config contracts.Configuration, cancelFlag task.CancelFlag, subDocumentRunner PluginRunner) contracts.PluginResult
}

T is the interface type for plugins.

type UpdateAssociation

type UpdateAssociation func(log log.T, documentID string, documentCreatedDate string, pluginOutputs map[string]*contracts.PluginResult, totalNumberOfPlugins int)

UpdateAssociation updates association status

Jump to

Keyboard shortcuts

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