Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllCommandTypes = []CommandType{ CmdVarSetAdd, CmdVarSetRemove, CmdVarScalarUpdate, CmdVarMapAdd, CmdVarMapRemove, CmdWebhookCall, CmdDeployReplay, CmdCleanUpReplay, }
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Type CommandType `json:"type"` // e.g., variable.set.add, webhook.call
Inputs json.RawMessage `json:"inputs"` // command-specific parameters
}
Command represents a single command to be executed when a rule is triggered.
type CommandEvent ¶
type CommandEvent struct {
Id string `json:"id"`
Source string `json:"source"`
Subject string `json:"subject"` // variable.set.add, webhook.call
DataContentType string `json:"dataContentType"`
Time time.Time `json:"time"`
HubName string `json:"hubName"`
Data map[string]interface{} `json:"data"` // Command parameters
CorrelationId string `json:"correlationId,omitempty"`
CausationId string `json:"causationId,omitempty"`
}
CommandEvent struct for workflow engine integration
type CommandType ¶
type CommandType string
const ( CmdVarSetAdd CommandType = "variable.set.add" CmdVarSetRemove CommandType = "variable.set.remove" CmdVarScalarUpdate CommandType = "variable.scalar.update" CmdVarMapAdd CommandType = "variable.map.add" CmdVarMapRemove CommandType = "variable.map.remove" CmdWebhookCall CommandType = "webhook.call" CmdDeployReplay CommandType = "replay.deploy" CmdCleanUpReplay CommandType = "replay.cleanup" )
func ParseCommandType ¶
func ParseCommandType(s string) (CommandType, error)
func (CommandType) String ¶
func (t CommandType) String() string
func (CommandType) Valid ¶
func (t CommandType) Valid() bool
type Rule ¶
type Rule struct {
Name string `json:"name"`
Trigger triggers.Trigger `json:"-"` // not part of wire shape; handled by custom (un)marshal
Commands []Command `json:"commands"`
}
Rule represents a rule that triggers a set of commands when a certain event occurs.
func (Rule) MarshalJSON ¶
MarshalJSON marshals the Rule into JSON.
func (*Rule) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Rule from JSON.
Click to show internal directories.
Click to hide internal directories.