cron

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

add by vincent.zhang for pigeon

Index

Constants

View Source
const (
	PIGEON_KEY              = "99a35ace8952f662cad672d2f6da5754"
	PIGEON_SOURE_NAME       = "vip-falcon"
	PIGEON_DEFAULT_FID      = 9560
	PIGEON_DEFAULT_AVC      = "000-000"
	PIGEON_FID_CREATE_ADMIN = "vincent.zhang"
)

Variables

View Source
var (
	IMWorkerChan     chan int
	SmsWorkerChan    chan int
	MailWorkerChan   chan int
	PigeonWorkerChan chan int //add by vincent.zhang for pigeon
)

Functions

func BuildCommonIMContent

func BuildCommonIMContent(event *model.Event) string

func BuildCommonMailContent

func BuildCommonMailContent(event *model.Event) string

func BuildCommonSMSContent

func BuildCommonSMSContent(event *model.Event) string

func Callback

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

func CleanExpiredEvent

func CleanExpiredEvent()

func CombineIM

func CombineIM()

func CombineMail

func CombineMail()

func CombineSms

func CombineSms()

func ConsumeIM

func ConsumeIM()

func ConsumeMail

func ConsumeMail()

func ConsumePigeon

func ConsumePigeon()

func ConsumeSms

func ConsumeSms()

func GenerateIMContent

func GenerateIMContent(event *model.Event) string

func GenerateMailContent

func GenerateMailContent(event *model.Event) string

func GeneratePigeon

func GeneratePigeon(event *model.Event, ip, hostgroup string) *amodel.Pigeon

func GenerateSmsContent

func GenerateSmsContent(event *model.Event) string

func HandleCallback

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

func InitSenderWorker

func InitSenderWorker()

func ParseUserIm

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

func ParseUserMail

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

func ParseUserSms

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

func ReadHighEvent

func ReadHighEvent()

func ReadLowEvent

func ReadLowEvent()

func SendIM

func SendIM(im *model.IM)

func SendIMList

func SendIMList(L []*model.IM)

func SendMail

func SendMail(mail *model.Mail)

func SendMailList

func SendMailList(L []*model.Mail)

func SendPigeon

func SendPigeon(pigeon *model.Pigeon)

func SendPigeonList

func SendPigeonList(L []*model.Pigeon)

func SendSms

func SendSms(sms *model.Sms)

func SendSmsList

func SendSmsList(L []*model.Sms)

Types

type ImDto

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

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 PigeonDto

type PigeonDto struct {
	Priority   int    `json:"priority"`
	Status     string `json:"status"` // OK or PROBLEM
	Endpoint   string `json:"endpoint"`
	Note       string `json;"note"`
	Metric     string `json:"metric"`
	Tags       string `json:"tags"`
	LeftValue  string `json:"leftValue"`
	Func       string `json:"func"`
	Operator   string `json:"operator"`
	RightValue string `json:"rightValue"`
	EventTime  string `json:"eventTime"`
	IP         string `json:"ip"`
	Domain     string `json:"Domain"`
}

add by vincent.zhang for pigeon

type PigeonFid

type PigeonFid struct {
	Fid int64 `json:"fid"`
}

type PigeonFidResponse

type PigeonFidResponse struct {
	Code    int        `json:"code"`
	Message string     `json:"message"`
	Object  *PigeonFid `json:"object"`
	Success bool       `json:"success"`
}

type PigeonResponse

type PigeonResponse struct {
	Success bool   `json:"success"`
	Object  string `json:"object"`
	Message string `json:"message"`
}

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