Documentation
¶
Index ¶
Constants ¶
View Source
const ( AlertEventType MdaiEventType = "alert" VarEventType MdaiEventType = "var" TriggerEventType MdaiEventType = "trigger.vars" AlertConsumerGroupName MdaiEventConsumerGroup = "alert-consumer-group" VarsConsumerGroupName MdaiEventConsumerGroup = "vars-consumer-group" TriggerConsumerGroupName MdaiEventConsumerGroup = "trigger-consumers" ManualVariablesEventSource = "manual_variables_api" PrometheusAlertsEventSource = "prometheus" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerInvoker ¶
HandlerInvoker is a function type that processes MdaiEvents.
type MdaiEvent ¶
type MdaiEvent struct {
ID string `json:"id,omitempty"`
Name string `json:"name"` // e.g. "alert_firing"
Version int `json:"version"` // schema version
Timestamp time.Time `json:"timestamp,omitempty"`
Payload string `json:"payload"`
Source string `json:"source"` // used in subject, could not be empty
SourceID string `json:"source_id"` // ex alert fingerprint
CorrelationID string `json:"correlation_id,omitempty"`
HubName string `json:"hub_name"`
RecursionDepth int `json:"recursion_depth,omitempty"` // recursion depth limit for events
}
MdaiEvent represents an event in the system.
func NewMdaiEvent ¶
func (*MdaiEvent) ApplyDefaults ¶
func (mdaiEvent *MdaiEvent) ApplyDefaults()
func (*MdaiEvent) MarshalLogObject ¶
func (mdaiEvent *MdaiEvent) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject signature requires it to return an error, but there's no way the code will generate one.
type MdaiEventConsumerGroup ¶
type MdaiEventConsumerGroup string
func (MdaiEventConsumerGroup) String ¶
func (consumerGroup MdaiEventConsumerGroup) String() string
type MdaiEventSubject ¶
type MdaiEventSubject struct {
// The specific MDAI Event stream this event belongs. Joined to Path with "."
Type MdaiEventType
// The path after the stream. Joined to preceding Type with "."
Path string
}
func NewMdaiEventSubject ¶
func NewMdaiEventSubject(stream MdaiEventType, path string) MdaiEventSubject
func (MdaiEventSubject) PrefixedString ¶
func (subject MdaiEventSubject) PrefixedString(prefix string) string
func (MdaiEventSubject) String ¶
func (subject MdaiEventSubject) String() string
type MdaiEventType ¶
type MdaiEventType string
func (MdaiEventType) String ¶
func (eventType MdaiEventType) String() string
Click to show internal directories.
Click to hide internal directories.