dropbox

package
v0.0.0-...-842a331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2021 License: LGPL-2.1 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertPostCommApi

type AlertPostCommApi struct {
	Title  string             `json:"title,omitempty"`
	Msg    string             `json:"msg"`
	StarTs string             `json:"startsTs,omitempty"`
	EndTs  string             `json:"endTs,omitempty"`
	Labels KV                 `json:"labels,omitempty"`
	Values map[string]float64 `json:"values,omitempty"`
}

func PromeAlertToAlertPostCommApi

func PromeAlertToAlertPostCommApi(alert alertTemplate.Alert, zone string) AlertPostCommApi

func (*AlertPostCommApi) ReportCC

func (api *AlertPostCommApi) ReportCC()

type GrafanaEvalMatch

type GrafanaEvalMatch struct {
	Tags   map[string]string `json:"tags,omitempty"`
	Metric string            `json:"metric"`
	Value  float64           `json:"value"`
}

type GrafanaWebhook

type GrafanaWebhook struct {
	Title       string              `json:"title"`
	State       string              `json:"state"`
	Msg         string              `json:"message"`
	EvalMatches []*GrafanaEvalMatch `json:"evalMatches"`
}

func (*GrafanaWebhook) GrafanaWebhookToAlertPostCommApi

func (alert *GrafanaWebhook) GrafanaWebhookToAlertPostCommApi(zone string) []*AlertPostCommApi

type KV

type KV map[string]string
'{
	"title": "CPU告警",     // 可选,标题信息
	"msg":"CPU异常告警。",   // 必选,通知信息
	"labels":{             // 必选,标签信息
			"cmdb_type" : "host",     // 可选,api的内部标签协议动态匹配
			"cmdb_name": "yw_prometheus"
	},
	"url": ""              // 可选,待定
}'

KV is a set of key/value string pairs.

func (KV) Add

func (kv KV) Add(keys map[string]string) KV

func (KV) Remove

func (kv KV) Remove(keys []string) KV

Remove returns a copy of the key/value set without the given keys.

type PromeAlerts

type PromeAlerts alertTemplate.Data

func (*PromeAlerts) Firing

func (p *PromeAlerts) Firing(zone string) []AlertPostCommApi

func (*PromeAlerts) Resolved

func (p *PromeAlerts) Resolved(zone string) []AlertPostCommApi

type Report

type Report struct {
	AlertPostCommApi
	Ts         string `json:"ts,omitempty"`
	Access_key string `json:"access_key,omitempty"`
	Random     string `json:"random,omitempty"`
}

func (*Report) SendReportMsg

func (report *Report) SendReportMsg(url string) (string, error)

func (*Report) SendReportMsgByToken

func (report *Report) SendReportMsgByToken(url, token string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL