warning

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const WARNING_KEY_PREFIX = "bifrost_warning_config_"

Variables

View Source
var IP string = ""
View Source
var WarningChan chan WarningContent

Functions

func AddNewWarningConfig

func AddNewWarningConfig(p WaringConfig) (string, error)

func AppendWarning

func AppendWarning(data WarningContent)

新增报警内容

func CheckWarngConfigBySendTest

func CheckWarngConfigBySendTest(config WaringConfig, c string) error

func DelWarningConfig

func DelWarningConfig(ID int) error

func GetWarningConfigList

func GetWarningConfigList() map[string]WaringConfig

func InitWarningConfigCache

func InitWarningConfigCache()

func RecoveryWarning added in v1.2.2

func RecoveryWarning(content *json.RawMessage)

func Register

func Register(name string, f WarningFunInterface)

Types

type Email

type Email struct {
	// contains filtered or unexported fields
}

func (*Email) SendWarning

func (This *Email) SendWarning(p map[string]interface{}, title, Body string) error

type EmailParam

type EmailParam struct {
	From     string
	To       string
	Password string
	SmtpHost string
	SmtpPort int
	NickName string
}

type WaringConfig

type WaringConfig struct {
	Type  string
	Param map[string]interface{}
}

type WarningContent

type WarningContent struct {
	Type       WarningType
	DbName     string
	SchemaName string
	TableName  string
	Channel    string
	Body       interface{}
	DateTime   string
	IP         string
}

type WarningFunInterface

type WarningFunInterface interface {
	SendWarning(p map[string]interface{}, title string, body string) error
}

type WarningType

type WarningType string
const (
	WARNINGERROR  WarningType = "ERROR"
	WARNINGNORMAL WarningType = "NORMAL"
)

type WeChatWorkParam

type WeChatWorkParam struct {
	ToUser     string `json:"touser"`
	ToParty    string `json:"toparty"`
	ToTag      string `json:"totag"`
	AgentId    int    `json:"agentid"`
	CorpID     string `json:"corpid"`
	CorpSecret string `json:"corpsecret"`
}

type WechatWork

type WechatWork struct {
	// contains filtered or unexported fields
}

func (*WechatWork) SendWarning

func (This *WechatWork) SendWarning(p map[string]interface{}, title string, Body string) error

Jump to

Keyboard shortcuts

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