processor

package
v0.0.0-...-84afe80 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package processor implements MDS plugin processor

Package processor implements MDS plugin processor processor_core contains functions that fetch messages and schedule them to be executed

Package processor implements MDS plugin processor processor_coreplugin contains the ICoreModule implementation

Package processor implements MDS plugin processor processor_scheduler contains the GetMessages Scheduler implementation

Package processor implements MDS plugin processor processor_state contains utilities that interact with the state manager

Package processor implements MDS plugin processor processor_utils contains utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockedMDS

type MockedMDS struct {
	mock.Mock
}

MockedMDS stands for a mock MDS service.

func (*MockedMDS) AcknowledgeMessage

func (mdsMock *MockedMDS) AcknowledgeMessage(log log.T, messageID string) error

AcknowledgeMessage mocks the service function with the same name.

func (*MockedMDS) DeleteMessage

func (mdsMock *MockedMDS) DeleteMessage(log log.T, messageID string) error

DeleteMessage mocks the service function with the same name.

func (*MockedMDS) FailMessage

func (mdsMock *MockedMDS) FailMessage(log log.T, messageID string, failureType service.FailureType) error

FailMessage mocks the service function with the same name.

func (*MockedMDS) GetMessages

func (mdsMock *MockedMDS) GetMessages(log log.T, instanceID string) (messages *ssmmds.GetMessagesOutput, err error)

GetMessages mocks the service function with the same name.

func (*MockedMDS) SendReply

func (mdsMock *MockedMDS) SendReply(log log.T, messageID string, payload string) error

SendReply mocks the service function with the same name.

func (*MockedMDS) Stop

func (mdsMock *MockedMDS) Stop()

Stop mocks the service function with the same name.

type MockedPluginRunner

type MockedPluginRunner struct {
	mock.Mock
}

MockedPluginRunner stands for a mock plugin runner.

func (*MockedPluginRunner) RunPlugins

func (runnerMock *MockedPluginRunner) RunPlugins(context context.T, documentID string, plugins []docModel.PluginState, sendResponse runpluginutil.SendResponse, cancelFlag task.CancelFlag) (pluginOutputs map[string]*contracts.PluginResult)

RunPlugins mocks a PluginRunner (which is a func).

type MockedReplyBuilder

type MockedReplyBuilder struct {
	mock.Mock
}

MockedReplyBuilder stands for a mock reply builder.

func (*MockedReplyBuilder) BuildReply

func (replyBuilderMock *MockedReplyBuilder) BuildReply(pluginID string, pluginResults map[string]*contracts.PluginResult) model.SendReplyPayload

BuildReply mocks a ReplyBuilder (which is a func).

type MockedSendResponse

type MockedSendResponse struct {
	mock.Mock
}

MockedSendResponse stands for a mock send response.

func (*MockedSendResponse) SendResponse

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

SendResponse mocks a SendResponse (which is a func).

type PluginRunner

type PluginRunner func(context context.T, documentID string, plugins []model.PluginState, sendResponse runpluginutil.SendResponse, cancelFlag task.CancelFlag) (pluginOutputs map[string]*contracts.PluginResult)

PluginRunner is a function that can run a set of plugins and return their outputs.

type Processor

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

Processor is an object that can process MDS messages.

func NewMdsProcessor

func NewMdsProcessor(context context.T) *Processor

NewMdsProcessor initializes a new mds processor with the given parameters.

func NewOfflineProcessor

func NewOfflineProcessor(context context.T) (*Processor, error)

NewOfflineProcessor initialize a new offline command document processor

func NewProcessor

func NewProcessor(context context.T, processorName string, processorService service.Service, commandWorkerLimit int, cancelWorkerLimit int, pollAssoc bool, supportedDocs []model.DocumentType) *Processor

NewProcessor performs common initialization for Mds and Offline processors

func (*Processor) ExecutePendingDocument

func (p *Processor) ExecutePendingDocument(docState *model.DocumentState)

submitDocForExecution moves doc to current folder and submit it for execution

func (*Processor) ModuleExecute

func (p *Processor) ModuleExecute(context context.T) (err error)

Execute starts the scheduling of the message processor plugin

func (*Processor) ModuleName

func (p *Processor) ModuleName() string

Name returns the module name

func (*Processor) ModuleRequestStop

func (p *Processor) ModuleRequestStop(stopType contracts.StopType) (err error)

RequestStop handles the termination of the message processor plugin job

type TopicPrefix

type TopicPrefix string

TopicPrefix is the prefix of the Topic field in an MDS message.

const (
	// SendCommandTopicPrefix is the topic prefix for a send command MDS message.
	SendCommandTopicPrefix TopicPrefix = "aws.ssm.sendCommand."

	// CancelCommandTopicPrefix is the topic prefix for a cancel command MDS message.
	CancelCommandTopicPrefix TopicPrefix = "aws.ssm.cancelCommand."

	// SendCommandTopicPrefixOffline is the topic prefix for a send command MDS message received from the offline service.
	SendCommandTopicPrefixOffline TopicPrefix = "aws.ssm.sendCommand.offline."

	// CancelCommandTopicPrefix is the topic prefix for a cancel command MDS message received from the offline service.
	CancelCommandTopicPrefixOffline TopicPrefix = "aws.ssm.cancelCommand.offline."

	CancelWorkersLimit = 3
)

Jump to

Keyboard shortcuts

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