Documentation ¶
Overview ¶
Package runpluginutil provides interfaces for running plugins that can be referenced by other plugins and a utility method for parsing documents
Index ¶
- func NoReply(messageID string, pluginID string, results map[string]*contracts.PluginResult)
- func NoUpdate(log log.T, documentID string, documentCreatedDate string, ...)
- func ParseDocument(context context.T, documentRaw []byte, orchestrationDir string, ...) (pluginsInfo []model.PluginState, err error)
- type PluginRegistry
- type PluginRunner
- type SendDocumentLevelResponse
- type SendResponse
- type T
- type UpdateAssociation
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 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 ¶
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