Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorIntoEvent(event api.Event, message string) api.Event
- func ErrorToEvent(message string) *api.Event
- func GenAlertsOriginData(alerts []Alert) map[string]interface{}
- type Alert
- type AlertMap
- type DefaultEvent
- func (de *DefaultEvent) Body() []byte
- func (de *DefaultEvent) DeepCopy() api.Event
- func (de *DefaultEvent) Fill(meta api.Meta, header map[string]interface{}, body []byte)
- func (de *DefaultEvent) Header() map[string]interface{}
- func (de *DefaultEvent) Meta() api.Meta
- func (de *DefaultEvent) Release()
- func (de *DefaultEvent) String() string
- type DefaultMeta
- type Factory
- type PackageAndSendAlerts
- type Pool
Constants ¶
View Source
const ( DefaultAlertKey = "_defaultAlertKey" NoDataKey = "NoDataAlert" Addition = "additions" Fields = "fields" ReasonKey = "reason" AlertOriginDataKey = "Events" )
View Source
const ( SystemKeyPrefix = "system" PrivateKeyPrefix = "@private" SystemPipelineKey = SystemKeyPrefix + "PipelineName" SystemSourceKey = SystemKeyPrefix + "SourceName" SystemProductTimeKey = SystemKeyPrefix + "ProductTime" Body = "body" )
Variables ¶
View Source
var ErrorDropEvent = errors.New("drop event")
Functions ¶
func ErrorIntoEvent ¶ added in v1.5.0
func ErrorToEvent ¶ added in v1.5.0
func GenAlertsOriginData ¶ added in v1.5.0
Types ¶
type DefaultEvent ¶
type DefaultEvent struct { H map[string]interface{} `json:"header"` B []byte `json:"body"` M api.Meta `json:"meta"` }
func NewEvent ¶
func NewEvent(header map[string]interface{}, body []byte) *DefaultEvent
func (*DefaultEvent) Body ¶
func (de *DefaultEvent) Body() []byte
func (*DefaultEvent) DeepCopy ¶ added in v1.4.0
func (de *DefaultEvent) DeepCopy() api.Event
func (*DefaultEvent) Fill ¶
func (de *DefaultEvent) Fill(meta api.Meta, header map[string]interface{}, body []byte)
func (*DefaultEvent) Header ¶
func (de *DefaultEvent) Header() map[string]interface{}
func (*DefaultEvent) Meta ¶
func (de *DefaultEvent) Meta() api.Meta
func (*DefaultEvent) Release ¶
func (de *DefaultEvent) Release()
func (*DefaultEvent) String ¶
func (de *DefaultEvent) String() string
type DefaultMeta ¶
type DefaultMeta struct {
Properties map[string]interface{} `json:"properties"`
}
func NewDefaultMeta ¶
func NewDefaultMeta() *DefaultMeta
func (*DefaultMeta) Get ¶
func (dm *DefaultMeta) Get(key string) (value interface{}, exist bool)
func (*DefaultMeta) GetAll ¶
func (dm *DefaultMeta) GetAll() map[string]interface{}
func (*DefaultMeta) Set ¶
func (dm *DefaultMeta) Set(key string, value interface{})
func (*DefaultMeta) Source ¶
func (dm *DefaultMeta) Source() string
func (*DefaultMeta) String ¶
func (dm *DefaultMeta) String() string
type PackageAndSendAlerts ¶ added in v1.5.0
type PackageAndSendAlerts func(alerts []Alert)
Click to show internal directories.
Click to hide internal directories.