Documentation ¶
Overview ¶
Package parser contains utilities for parsing and encoding MDS/SSM messages.
Index ¶
- func ParseMessageWithParams(log log.T, payload string) (parsedMessage messageContracts.SendCommandPayload, err error)
- func PrepareReplyPayload(pluginID string, runtimeStatuses map[string]*contracts.PluginRuntimeStatus, ...) (payload messageContracts.SendReplyPayload)
- func PrepareReplyPayloadToUpdateDocumentStatus(agentInfo contracts.AgentInfo, documentStatus contracts.ResultStatus, ...) (payload messageContracts.SendReplyPayload)
- func PrepareRuntimeStatuses(log log.T, pluginOutputs map[string]*contracts.PluginResult) (runtimeStatuses map[string]*contracts.PluginRuntimeStatus)
- func ReplacePluginParameters(input map[string]*contracts.PluginConfig, params map[string]interface{}, ...) (result map[string]*contracts.PluginConfig)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseMessageWithParams ¶
func ParseMessageWithParams(log log.T, payload string) (parsedMessage messageContracts.SendCommandPayload, err error)
ParseMessageWithParams parses an MDS message and replaces the parameters where needed.
func PrepareReplyPayload ¶
func PrepareReplyPayload(pluginID string, runtimeStatuses map[string]*contracts.PluginRuntimeStatus, dateTime time.Time, agentInfo contracts.AgentInfo) (payload messageContracts.SendReplyPayload)
PrepareReplyPayload creates the payload object for SendReply based on plugin outputs.
func PrepareReplyPayloadToUpdateDocumentStatus ¶
func PrepareReplyPayloadToUpdateDocumentStatus(agentInfo contracts.AgentInfo, documentStatus contracts.ResultStatus, documentTraceOutput string) (payload messageContracts.SendReplyPayload)
PrepareReplyPayloadToUpdateDocumentStatus creates the payload object for SendReply based on document status change.
func PrepareRuntimeStatuses ¶
func PrepareRuntimeStatuses(log log.T, pluginOutputs map[string]*contracts.PluginResult) (runtimeStatuses map[string]*contracts.PluginRuntimeStatus)
PrepareRuntimeStatuses creates runtime statuses from plugin outputs. contracts.PluginResult and contracts.PluginRuntimeStatus are mostly same. however they are decoupled on purpose so that we can do any special handling / serializing when sending response to server side.
func ReplacePluginParameters ¶
func ReplacePluginParameters(input map[string]*contracts.PluginConfig, params map[string]interface{}, logger log.T) (result map[string]*contracts.PluginConfig)
ReplacePluginParameters replaces parameters with their values, within the plugin Properties.
Types ¶
This section is empty.