engine

package
v0.0.0-...-3f59448 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package engine contains the general purpose plugin runner of the plugin framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunPlugins

func RunPlugins(
	context context.T,
	documentID string,
	plugins map[string]*contracts.Configuration,
	pluginRegistry plugin.PluginRegistry,
	sendReply SendResponse,
	cancelFlag task.CancelFlag,
) (pluginOutputs map[string]*contracts.PluginResult)

RunPlugins executes a set of plugins. The plugin configurations are given in a map with pluginId as key. Outputs the results of running the plugins, indexed by pluginId.

Types

type MockedPluginRunner

type MockedPluginRunner struct {
	mock.Mock
}

MockedPluginRunner stands for a mock plugin runner.

func (*MockedPluginRunner) RunPlugins

func (runnerMock *MockedPluginRunner) RunPlugins(context context.T, plugins map[string]*contracts.Configuration, cancelFlag task.CancelFlag) (pluginOutputs map[string]*contracts.PluginResult)

RunPlugins mocks the RunPlugins method.

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.

Jump to

Keyboard shortcuts

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