alert

package
v1.3.3-testnet Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertConfig

type AlertConfig struct {
	// custom tags are usually used to differentiate between different networks and enviroments
	// such as mainnet/testnet, prod/test/dev or any custom info for more details.
	CustomTags []string `default:"[testnet,dev]"`
	DingTalk   DingTalkConfig
}

type DingTalkAlerter

type DingTalkAlerter struct {
	// ding talk robot
	dingrobot.Roboter
	// contains filtered or unexported fields
}

func MustNewDingTalkAlerterFromViper

func MustNewDingTalkAlerterFromViper() *DingTalkAlerter

func NewDingTalkAlerter

func NewDingTalkAlerter(conf AlertConfig) *DingTalkAlerter

func (*DingTalkAlerter) Send

func (dta *DingTalkAlerter) Send(level, brief, detail string) error

type DingTalkConfig

type DingTalkConfig struct {
	Enabled   bool
	WebHook   string
	Secret    string
	AtMobiles []string
	IsAtAll   bool
}

type LogrusAlertHook

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

func NewLogrusAlertHook

func NewLogrusAlertHook(alerter *DingTalkAlerter, lvls []logrus.Level) *LogrusAlertHook

func (*LogrusAlertHook) Fire

func (hook *LogrusAlertHook) Fire(logEntry *logrus.Entry) error

func (*LogrusAlertHook) Levels

func (hook *LogrusAlertHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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