config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmMessage added in v0.0.3

type AlarmMessage struct {
	Level        string // 告警等级 P1
	Type         string // 类型 PROBLEM,OK
	Endpoint     string // 主机host或者ip
	Desc         string // 告警描述
	Counter      string // 告警指标
	Tags         string // tags
	TriggerCount int    // 间隔
	Count        int    // 当前告警次数
	Time         time.Time
	Expression   string
}

type Config

type Config struct {
	Addr     string   `json:"addr"`
	DingTalk DingTalk `json:"dingTalk"`

	Weixin Weixin `json:"weixin"`
}

Config 配置

func Read

func Read() Config

Read 读取配置

type DingTalk

type DingTalk struct {
	Enable bool `json:"enable"`

	Level        uint `json:"level"`
	TemplateFile string
	MessageType  string // markdown ,text
}

DingTalk 钉钉配置

type Weixin

type Weixin struct {
	Enable         bool
	CorpID         string `json:"corpID"`
	AgentID        string `json:"agentId"`
	Secret         string `json:"secret"`
	EncodingAESKey string `json:"encodingAESKey"`
}

Weixin 微信配置

Jump to

Keyboard shortcuts

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