cron

package
v0.0.0-...-a9119a5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IMWorkerChan       chan int
	FailedIMWorkerChan chan int
	SmsWorkerChan      chan int
	MailWorkerChan     chan int
	PhoneWorkerChan    chan int
)
View Source
var BlockMonitorCounter sync.Map

Functions

func AlarmIsUnionString

func AlarmIsUnionString(event *model.Event) string

func BuildCommonIMContent

func BuildCommonIMContent(event *model.Event) string

func BuildCommonMailContent

func BuildCommonMailContent(event *model.Event, uic string, amstag string, grps string) string

func BuildCommonPhoneContent

func BuildCommonPhoneContent(event *model.Event) string

func BuildCommonSMSContent

func BuildCommonSMSContent(event *model.Event, uic string, amstag string, grps string) string

func BuildCommonSMSContent(event *model.Event) string {

func BuildLarkCardImContent

func BuildLarkCardImContent(userNames []string, event *model.Event, amstag string, grps string) map[string]string

func Callback

func Callback(event *model.Event, action *api.Action, grps string) string

func CleanExpiredEvent

func CleanExpiredEvent()

func CombineIM

func CombineIM()

func CombineMail

func CombineMail()

func CombineSms

func CombineSms()

func CommonFilterBlock

func CommonFilterBlock(event *cmodel.Event, userMap map[string]*uic.User) map[string]*uic.User

func ConsumeFailedIM

func ConsumeFailedIM()

func ConsumeIM

func ConsumeIM()

func ConsumeMail

func ConsumeMail()

func ConsumePhone

func ConsumePhone()

func ConsumeSms

func ConsumeSms()

func FormatMetricTags

func FormatMetricTags(event *model.Event) string

func FormatOneFuncValue

func FormatOneFuncValue(event *model.Event) string

func GenerateIMContent

func GenerateIMContent(event *model.Event) string

func GenerateMailContent

func GenerateMailContent(event *model.Event, amstag string, grps string) string

func GeneratePhoneContent

func GeneratePhoneContent(event *model.Event) string

func GenerateSmsContent

func GenerateSmsContent(event *model.Event, amstag string, grps string) string

func GenerateUserMap

func GenerateUserMap(event *cmodel.Event, action *api.Action) map[string]*uic.User

func GetBlockMonitors

func GetBlockMonitors()

func GetRebotTokenByIdAndSecret

func GetRebotTokenByIdAndSecret(app_id, app_secret, url string) string

func GetTokenFromCache

func GetTokenFromCache(token string) string

func HandleCallback

func HandleCallback(event *model.Event, action *api.Action, amstag string, grps string)

func HttpSendPhone

func HttpSendPhone(user, content string) error

func HttpSendSms

func HttpSendSms(sms *model.Sms) error

func InitSenderWorker

func InitSenderWorker()

func LarkBotCard

func LarkBotCard(url, bodyData, Tos, token string) error

func LarkBotText

func LarkBotText(url, Content, Tos, token string) error

func LarkCardButton

func LarkCardButton(name, url string) map[string]interface{}

func LarkCardCallBackButton

func LarkCardCallBackButton(name string, data interface{}) map[string]interface{}

func LowLevelFilterBlock

func LowLevelFilterBlock(event *cmodel.Event, userMap map[string]*uic.User) map[string]*uic.User

func ParseUserIm

func ParseUserIm(event *cmodel.Event, action *api.Action, amstag string, grps string)

func ParseUserMail

func ParseUserMail(event *cmodel.Event, action *api.Action, amstag string, grps string)

func ParseUserSms

func ParseUserSms(event *cmodel.Event, action *api.Action, amstag string, grps string)

func ReadHighEvent

func ReadHighEvent()

func ReadLowEvent

func ReadLowEvent()

func RefreshBlockMonitor

func RefreshBlockMonitor()

func SendFailedIMList

func SendFailedIMList(L []*model.IM)

func SendIM

func SendIM(im *model.IM, queue string, worker chan int)

func SendIMList

func SendIMList(L []*model.IM)

func SendMail

func SendMail(mail *model.Mail)

func SendMailList

func SendMailList(L []*model.Mail)

func SendPhone

func SendPhone(sms *model.Sms)

func SendPhoneList

func SendPhoneList(L []*model.Sms)

func SendSms

func SendSms(sms *model.Sms)

func SendSmsList

func SendSmsList(L []*model.Sms)

func UnionAlarmFormatFuncValue

func UnionAlarmFormatFuncValue(event *model.Event) string

Types

type BotResp

type BotResp struct {
	Data interface{} `json:"data"`
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
}

type ImDto

type ImDto struct {
	Priority        int    `json:"priority"`
	Metric          string `json:"metric"`
	Content         string `json:"content"`
	IM              string `json:"im"`
	Name            string `json:"name"`
	Status          string `json:"status"`
	LarkCardContent string `json:"lark_card_content"`
}

type MailDto

type MailDto struct {
	Priority int    `json:"priority"`
	Metric   string `json:"metric"`
	Subject  string `json:"subject"`
	Content  string `json:"content"`
	Email    string `json:"email"`
	Status   string `json:"status"`
}

type SmsDto

type SmsDto struct {
	Priority int    `json:"priority"`
	Metric   string `json:"metric"`
	Content  string `json:"content"`
	Phone    string `json:"phone"`
	Status   string `json:"status"`
}

Jump to

Keyboard shortcuts

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