Documentation ¶
Overview ¶
Package utils provides utility functions to be used by interactors
Package utils provides utility functions to be used by interactors
Index ¶
- Constants
- Variables
- func IsValidReplyRequest(filename string, name contracts.UpstreamServiceName) bool
- func LoadProcessorWorkerConfig(context context.T) map[WorkerName]*ProcessorWorkerConfig
- func ParseCancelCommandMessage(context context.T, msg model.InstanceMessage, ...) (*contracts.DocumentState, error)
- func ParseSendCommandMessage(context context.T, msg model.InstanceMessage, ...) (*contracts.DocumentState, error)
- func PrepareReplyPayloadFromIntermediatePluginResults(log log.T, pluginID string, agentInfo contracts.AgentInfo, ...) (payload messageContracts.SendReplyPayload)
- func PrepareReplyPayloadToUpdateDocumentStatus(agentInfo contracts.AgentInfo, documentStatus contracts.ResultStatus, ...) (payload messageContracts.SendReplyPayload)
- func Validate(msg *ssmmds.Message) error
- type ProcessorName
- type ProcessorWorkerConfig
- type TopicPrefix
- type WorkerName
Constants ¶
const ( // CloudWatchLogGroupNamePrefix CloudWatch output's log group name prefix CloudWatchLogGroupNamePrefix = "/aws/ssm/" // 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" // SendFailedReplyFrequencyMinutes is the frequency at which to send failed reply requests back to MDS SendFailedReplyFrequencyMinutes = 5 )
Variables ¶
var ( // DocumentWorkerName represents document worker name DocumentWorkerName = WorkerName(filepath.Base(appconfig.DefaultDocumentWorker)) // SessionWorkerName represents session worker name SessionWorkerName = WorkerName(filepath.Base(appconfig.DefaultSessionWorker)) )
Functions ¶
func IsValidReplyRequest ¶
func IsValidReplyRequest(filename string, name contracts.UpstreamServiceName) bool
IsValidReplyRequest checks whether the reply is valid and had timed or not
func LoadProcessorWorkerConfig ¶
func LoadProcessorWorkerConfig(context context.T) map[WorkerName]*ProcessorWorkerConfig
LoadProcessorWorkerConfig loads all the processor and worker configurations used for initializing processors We launch equal number of processors returned by this function in message handler
func ParseCancelCommandMessage ¶
func ParseCancelCommandMessage(context context.T, msg model.InstanceMessage, upstreamService contracts.UpstreamServiceName) (*contracts.DocumentState, error)
ParseCancelCommandMessage parses send command message
func ParseSendCommandMessage ¶
func ParseSendCommandMessage(context context.T, msg model.InstanceMessage, messagesOrchestrationRootDir string, upstreamService contracts.UpstreamServiceName) (*contracts.DocumentState, error)
ParseSendCommandMessage parses send command message
func PrepareReplyPayloadFromIntermediatePluginResults ¶
func PrepareReplyPayloadFromIntermediatePluginResults(log log.T, pluginID string, agentInfo contracts.AgentInfo, outputs map[string]*contracts.PluginResult, ableToOpenMGSConnection *bool) (payload messageContracts.SendReplyPayload)
PrepareReplyPayloadFromIntermediatePluginResults parses send reply payload
func PrepareReplyPayloadToUpdateDocumentStatus ¶
func PrepareReplyPayloadToUpdateDocumentStatus(agentInfo contracts.AgentInfo, documentStatus contracts.ResultStatus, documentTraceOutput string, ableToOpenMGSConnection *bool) (payload messageContracts.SendReplyPayload)
PrepareReplyPayloadToUpdateDocumentStatus creates the payload object for SendReply based on document status change.
Types ¶
type ProcessorName ¶
type ProcessorName string
ProcessorName represents the currently supported processor name
const ( // CommandProcessor represents the command processor wrapper which handles send command and cancel command CommandProcessor ProcessorName = "CommandProcessor" // SessionProcessor represents the session processor wrapper which handles start session and terminate session SessionProcessor ProcessorName = "SessionProcessor" )
type ProcessorWorkerConfig ¶
type ProcessorWorkerConfig struct { ProcessorName ProcessorName WorkerName WorkerName StartWorkerLimit int CancelWorkerLimit int StartWorkerDocType contracts.DocumentType CancelWorkerDocType contracts.DocumentType StartWorkerBufferLimit int CancelWorkerBufferLimit int }
ProcessorWorkerConfig defines the different processor configurations along with worker details
type TopicPrefix ¶
type TopicPrefix string
TopicPrefix is the prefix of the Topic field in an MDS message.