Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct { Reason string `bson:"reason" json:"reason,omitempty"` // 触发原因, 比如 创建/删除/绑定/告警/恢复 Message string `bson:"message" json:"message,omitempty"` // 事件消息, ResourceType string `bson:"resource_type" json:"resource_type"` // 资源类型, ResourceUUID string `bson:"resource_uuid" json:"resource_uuid"` // 资源UUID, Data interface{} `bson:"data" json:"data,omitempty"` // 事件具体数据 }
Body 事件具体数据
type Header ¶
type Header struct { ID string `bson:"_id" json:"id,omitempty"` // 事件ID Time ftime.Time `bson:"time" json:"time,omitempty"` // 事件发生时间(毫秒) Source string `bson:"source" json:"source,omitempty"` // 事件来源, 比如cmdb Level Level `bson:"level" json:"level,omitempty"` // 事件等级 Label map[string]string `bson:"label" json:"label,omitempty"` // 标签 Meta Meta `bson:"meta" json:"meta,omitempty"` // 事件的元数据 }
Header 事件元数据
type Level ¶
type Level uint
Level 事件基本
func ParseLevel ¶ added in v0.3.3
ParseLevel Parse Level from string
func (Level) MarshalJSON ¶ added in v0.3.3
MarshalJSON todo
func (*Level) UnmarshalJSON ¶ added in v0.3.3
UnmarshalJSON todo
type Meta ¶ added in v0.3.3
type Meta interface { // Put associates the specified value with the specified key. If the map // previously contained a mapping for the key, the old value is replaced and // returned. The key can be expressed in dot-notation (e.g. x.y) to put a value // into a nested map. // // If you need insert keys containing dots then you must use bracket notation // to insert values (e.g. m[key] = value). Put(key string, value interface{}) (interface{}, error) // Delete deletes the given key from the map. Delete(key string) error // GetValue 获取值 Get(key string) (interface{}, error) }
Meta todo
Click to show internal directories.
Click to hide internal directories.