notify

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotifyTypeMail    = 1
	NotifyTypeWebHook = 2
)

Variables

This section is empty.

Functions

func Init

func Init(mail *Mail, web *WebHook)

func Send

func Send(msg *Message)

func Serve

func Serve()

Types

type Mail

type Mail struct {
	Port     int
	From     string
	Host     string
	Secret   string
	Nickname string
}

func (*Mail) SendMsg

func (mail *Mail) SendMsg(msg *Message)

type Message

type Message struct {
	Type      int
	IP        string
	Subject   string
	Body      string
	To        []string
	OccurTime string
}

func (*Message) Check

func (m *Message) Check()

type Noticer

type Noticer interface {
	SendMsg(*Message)
}

type WebHook

type WebHook struct {
	Kind string
	Url  string
}

func (*WebHook) SendMsg

func (w *WebHook) SendMsg(msg *Message)

Jump to

Keyboard shortcuts

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