valarm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Options *Options
	// contains filtered or unexported fields
}

func New

func New(options map[string]any) (alarm *Alarm, err error)

New create new alarm

func (*Alarm) GetMsg

func (alarm *Alarm) GetMsg(msgM vmap.M) (dataJson string)

GetMsg get message

func (*Alarm) Process

func (alarm *Alarm) Process() (data *gmap.Map)

Process processes message

func (*Alarm) Push

func (alarm *Alarm) Push(title string, service string, trace string, content string)

Push pushes the data into the queue data deduplication rule: service + title + trace

func (*Alarm) Run

func (alarm *Alarm) Run()

Run send msg

func (*Alarm) RunCron

func (alarm *Alarm) RunCron() (err error)

RunCron send msg by cron

func (*Alarm) Send

func (alarm *Alarm) Send(msg string) (err error)

Send sends message

func (*Alarm) SetConfig

func (alarm *Alarm) SetConfig(options map[string]any) (err error)

SetConfig set config

type Options

type Options struct {
	QueueMaxSize int
	SendInterval int // second
	Url          string
}

Jump to

Keyboard shortcuts

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