service

package
v0.0.0-...-bcde5d8 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TYPE_FTQQ_V1 = "ftqq_v1"
View Source
const TYPE_FTQQ_V2 = "ftqq_v2"
View Source
const TYPE_QMSG_CHAT = "qmsg_chat"
View Source
const TYPE_QMSG_GROUP_CHAT = "qmsg_group_chat"
View Source
const TYPE_TELEGRAM = "telegram"

Variables

This section is empty.

Functions

func TesterHandler

func TesterHandler(targetArr []TargetConfig, notifierConfig NotifierConfig) string

TesterHandler is the entry func of the application.

Types

type FtqqV1Notifier

type FtqqV1Notifier struct{}

FtqqV1Notifier support WeChat .etc, see https://sct.ftqq.com/

func (FtqqV1Notifier) Notify

func (notifier FtqqV1Notifier) Notify(msgToSend string, config NotifierConfig)

type FtqqV2Notifier

type FtqqV2Notifier struct{}

FtqqV2Notifier support WeChat .etc, see https://sct.ftqq.com/

func (FtqqV2Notifier) Notify

func (notifier FtqqV2Notifier) Notify(msgToSend string, config NotifierConfig)

type Notifier

type Notifier interface {
	Notify(msgToSend string, config NotifierConfig)
}

Notifier is the abstract interface for notifying users.

func GetNotifierByType

func GetNotifierByType(notifierType string) Notifier

GetNotifierByType is the way to produce concret notifier singleton instance.

type NotifierConfig

type NotifierConfig struct {
	FtqqV1Key      string
	FtqqV2Key      string
	QmsgKey        string
	TelegramToken  string
	TelegramChatId int64
	TelegramBot    *tgbotapi.BotAPI
}

type QmsgChatNotifier

type QmsgChatNotifier struct{}

QmsgChatNotifier support QQ single chat, see https://qmsg.zendee.cn/index.html

func (QmsgChatNotifier) Notify

func (notifier QmsgChatNotifier) Notify(msgToSend string, config NotifierConfig)

type QmsgGroupChatNotifier

type QmsgGroupChatNotifier struct{}

QmsgGroupChatNotifier support QQ single chat, see https://qmsg.zendee.cn/index.html

func (QmsgGroupChatNotifier) Notify

func (notifier QmsgGroupChatNotifier) Notify(msgToSend string, config NotifierConfig)

type Result

type Result struct {
	URL     string
	Msg     string
	Succeed bool
}

Result is the return msg combination struct for the tester.

type TargetConfig

type TargetConfig struct {
	URL                string `json:"url"`
	ExpectedStatusCode int    `json:"expectedStatusCode"`
	IgnoreAnalysis     bool   `json:"ignoreAnalysis"`
	NotifyMethod       string `json:"notifyMethod"`
}

TargetConfig is the info pair of the target url to be tested.

type TelegramNotifier

type TelegramNotifier struct{}

TelegramNotifier, support Telegram, see url-tester-func docs.

func (TelegramNotifier) Notify

func (notifier TelegramNotifier) Notify(msgToSend string, config NotifierConfig)

Jump to

Keyboard shortcuts

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