procs

package
v0.0.0-...-64bf223 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOT_DIR = "logs"
)

Variables

View Source
var AlarmFunc = func(sender string, receivers []string, text string) {
	params := map[string]interface{}{
		"Sender":    sender,
		"Receivers": receivers,
		"Text":      text,
	}
	json.NewEncoder(os.Stdout).Encode(params)
}

请赋值成自己的报警处理函数

View Source
var Handlers = map[string]HandlerFunc{}

Functions

func AlarmHandler

func AlarmHandler(cate, subcate, body string, params map[string]interface{})

func Doit

func Doit(cate, subcate, body string)

func FileHandler

func FileHandler(cate, subcate, body string, params map[string]interface{})

func RegisterHandler

func RegisterHandler(name string, handler HandlerFunc)

Types

type AlarmParam

type AlarmParam struct {
	Sender    string
	Receivers []string
	Includes  []string
	Excludes  []string
}

type AlarmStat

type AlarmStat struct {
	LastTime time.Time
	LastText string
}

type HandlerFunc

type HandlerFunc func(cate, subcate, body string, params map[string]interface{})

Jump to

Keyboard shortcuts

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