alert

package
v0.0.0-...-3af07a4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSMSSendLimit

func CheckSMSSendLimit(method string) bool

func CheckSendTimeRange

func CheckSendTimeRange(alertType string) bool

func CountRecentFailedLoginLogs

func CountRecentFailedLoginLogs(minutes uint, failCount uint) (int, bool, error)

func CountRecentFailedSSHLog

func CountRecentFailedSSHLog(minutes uint, maxAllowed uint) (int, bool, error)

func CreateAlertParams

func CreateAlertParams(param string) []dto.Param

func CreateEmailAlertLog

func CreateEmailAlertLog(create dto.AlertLogCreate, alert dto.AlertDTO, params []dto.Param, transport *http.Transport, agentInfo *dto.AgentInfo) error

func CreateNewAlertTask

func CreateNewAlertTask(quota, alertType, quotaType, method string)

func CreateTaskScanEmailAlertLog

func CreateTaskScanEmailAlertLog(alert dto.AlertDTO, create dto.AlertLogCreate, pushAlert dto.PushAlert, method string, transport *http.Transport, agentInfo *dto.AgentInfo) error

func FindRecentSuccessLoginNotInWhitelist

func FindRecentSuccessLoginNotInWhitelist(minutes int, whitelist []string) ([]string, error)

func FindRecentSuccessLoginsNotInWhitelist

func FindRecentSuccessLoginsNotInWhitelist(minutes int, whitelist []string) ([]model.LoginLog, error)

func GetCronJobType

func GetCronJobType(alertType string) string

func GetCronJobTypeName

func GetCronJobTypeName(cronJobType string) string

func GetEmailContent

func GetEmailContent(alertType string, params []dto.Param, agentInfo *dto.AgentInfo) string

func ParseAlertSmsConfig

func ParseAlertSmsConfig(configJSON string) (dto.AlertSmsConfig, error)

func ProcessAlertDetail

func ProcessAlertDetail(alert dto.AlertDTO, project string, params []dto.Param, method string) string

func ProcessAlertRule

func ProcessAlertRule(alert dto.AlertDTO) string

func SaveAlertLog

func SaveAlertLog(create dto.AlertLogCreate, alertLog *model.AlertLog) error

Types

type Category

type Category struct {
	SendTimeRange string   `json:"sendTimeRange"`
	Type          []string `json:"type"`
}

type Settings

type Settings struct {
	NoticeAlert   Category `json:"noticeAlert"`
	ResourceAlert Category `json:"resourceAlert"`
}

Jump to

Keyboard shortcuts

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