alarm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendAlarm

func SendAlarm(msg string)

SendAlarm is global function to receive alarm message

Types

type AlarmBody

type AlarmBody struct {
	IP       string   `json:"ip"`
	Cluster  string   `json:"cluster"`
	AlarmMsg []string `json:"alarmMsg"`
}

AlarmBody defines alarm body sending to script or api

type Manager

type Manager struct {
	types.AlarmConfig
	// contains filtered or unexported fields
}

Manager is used to send alarm message

func NewManager

func NewManager(cfg *types.AlarmConfig) *Manager

NewManager returns an instance of alarm manager

func (*Manager) Name

func (a *Manager) Name() string

Name return module name

func (*Manager) Run

func (a *Manager) Run(stop <-chan struct{})

Run is the main loop to send alarm messages

type WeWorkMessage

type WeWorkMessage struct {
	MessageType string   `json:"msgtype"`
	Markdown    markdown `json:"markdown,omitempty"`
}

WeWorkMessage is the format of wework message

Jump to

Keyboard shortcuts

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