throttle

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TelegramThrottle

type TelegramThrottle struct {
	sync.Mutex
	// contains filtered or unexported fields
}

TelegramThrottle throttle for telegram monitor

func NewTelegramThrottle

func NewTelegramThrottle(ctx context.Context, cfg *TelegramThrottleCfg) (t *TelegramThrottle, err error)

NewTelegramThrottle create new TelegramThrottle

func (*TelegramThrottle) Allow

func (t *TelegramThrottle) Allow(alertType string) (ok bool)

Allow is allow alertType to push

type TelegramThrottleCfg

type TelegramThrottleCfg struct {
	TotleNPerSec, TotleBurst         int
	EachTitleNPerSec, EachTitleBurst int
}

TelegramThrottleCfg configuration for TelegramThrottle

Jump to

Keyboard shortcuts

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