processor

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: 29 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 ICorePlugin implementation

Package processor implements MDS plugin processor processor_managedinstance removes dependency on instance meta data for managed instances.

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

func IsDocumentNotSupportedBySsmAgent

func IsDocumentNotSupportedBySsmAgent(docName string) bool

IsDocumentNotSupportedBySsmAgent returns true if the given SSM document is not supported by ssm agent

Types

type ManagedInstanceDocumentProperties

type ManagedInstanceDocumentProperties struct {
	RunCommand []string
	ID         string
}

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 map[string]*contracts.Configuration, sendResponse engine.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 map[string]*contracts.Configuration, sendResponse engine.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 NewProcessor

func NewProcessor(context context.T) *Processor

NewProcessor initializes a new mds processor with the given parameters.

func (*Processor) Execute

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

Execute starts the scheduling of the message processor plugin

func (*Processor) Name

func (p *Processor) Name() string

Name returns the Plugin Name

func (*Processor) RequestStop

func (p *Processor) RequestStop(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."

	CancelWorkersLimit = 3
)

Jump to

Keyboard shortcuts

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