Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateReversePolishNotation(labelmap map[string]string, expression string) bool
- func Converse2ReversePolishNotation(root *Node) string
- func GenerateJsonHeader() map[string]string
- func HttpGet(url string, params map[string]string, headers map[string]string) (*http.Response, error)
- func HttpPost(url string, params map[string]string, headers map[string]string, body []byte) (*http.Response, error)
- func IsValid(s string) bool
- func PostorderTraversal(root *Node, list *[]string)
- func UpdateRecovery2Send(ug UserGroup, alert Alert, users []string, alertId int64, alertCount int, ...)
- type Alert
- type AlertForShow
- type Alerts
- type AuthModel
- type BrokenList
- type Confirm
- type Msg
- type Node
- type Ready2Send
- type Res
- type SingleAlert
- type UserGroup
- type ValidUserGroup
Constants ¶
View Source
const ( AlertMethodSms = "SMS" AlertMethodLanxin = "LANXIN" AlertMethodCall = "CALL" AlertMethodHook = "HOOK" AlertMethodDingTalk = "DINGTALK" )
Variables ¶
View Source
var ErrHttpRequest = errors.New("create HTTP request failed")
View Source
var Lock sync.Mutex
View Source
var Maintain map[string]bool
View Source
var Recover2Send = map[string]map[[2]int64]*Ready2Send{
AlertMethodLanxin: {},
}
View Source
var RuleCount map[[2]int64]int64
View Source
var Rw sync.RWMutex
Functions ¶
func GenerateJsonHeader ¶
func PostorderTraversal ¶
Types ¶
type Alert ¶
type Alert struct { ActiveAt time.Time `json:"active_at"` Annotations struct { Description string `json:"description"` Summary string `json:"summary"` RuleId string `json:"rule_id"` } `json:"annotations"` FiredAt time.Time `json:"fired_at"` Labels map[string]string `json:"labels"` LastSentAt time.Time `json:"last_sent_at"` ResolvedAt time.Time `json:"resolved_at"` State int `json:"state"` ValidUntil time.Time `json:"valid_until"` Value float64 `json:"value"` }
type AlertForShow ¶
type AlertForShow struct { Id int64 `json:"id,omitempty"` RuleId int64 `json:"rule_id"` Labels map[string]string `json:"labels"` Value float64 `json:"value"` Count int `json:"count"` Status int8 `json:"status"` Summary string `json:"summary"` Description string `json:"description"` ConfirmedBy string `json:"confirmed_by"` FiredAt *time.Time `json:"fired_at"` ConfirmedAt *time.Time `json:"confirmed_at"` ConfirmedBefore *time.Time `json:"confirmed_before"` ResolvedAt *time.Time `json:"resolved_at"` }
type BrokenList ¶
type BrokenList struct { Hosts []struct { Hostname string `json:"hostname"` } `json:"hosts"` Error interface{} `json:"error"` }
type Ready2Send ¶
type Ready2Send struct { RuleId int64 //告警id Start int64 // User []string // 告警人员列表 Alerts []SingleAlert }
type SingleAlert ¶
type UserGroup ¶
type UserGroup struct { Id int64 StartTime string EndTime string Start int Period int ReversePolishNotation string User string Group string DutyGroup string Method string }
type ValidUserGroup ¶
Click to show internal directories.
Click to hide internal directories.