notify

package
v0.8.18 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UrlGetToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken"
	UrlSend     = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailNotifer

type EmailNotifer struct {
	Logger *zap.Logger
	From   string
	//Receivers []string
	SMTP     SmtpSettings
	Template map[string]*EmailTmpl
	Once     sync.Once
}

func (*EmailNotifer) PostInit

func (en *EmailNotifer) PostInit() error

func (*EmailNotifer) Send

func (en *EmailNotifer) Send(tmpl string, data map[string]interface{}, attachments ...string) error

type EmailTmpl

type EmailTmpl struct {
	Subject string
	Body    string
	// Notfound string
	Receivers    []string
	CcReceivers  []string
	BccReceivers []string
	// contains filtered or unexported fields
}

type SendResp

type SendResp struct {
	Errcode        int    `json:"errcode"`
	Errmsg         string `json:"errmsg"`
	Invalidparty   string `json:"invalidparty"`
	Invalidtag     string `json:"invalidtag"`
	Invaliduser    string `json:"invaliduser"`
	Msgid          string `json:"msgid"`
	ResponseCode   string `json:"response_code"`
	Unlicenseduser string `json:"unlicenseduser"`
}

type SmtpSettings

type SmtpSettings struct {
	Host     string
	Port     int
	Username string
	Password string
	Tls      bool
	// contains filtered or unexported fields
}

type TeamsNotify

type TeamsNotify struct {
	Logger  *zap.Logger
	Webhook string
}

type TeamsTmpl

type TeamsTmpl struct {
}

type TokenCache

type TokenCache struct {
	Created time.Time
	Expired time.Duration
	Token   string
}

type TokenResp

type TokenResp struct {
	AccessToken string `json:"access_token"`
	Errcode     int    `json:"errcode"`
	Errmsg      string `json:"errmsg"`
	ExpiresIn   int    `json:"expires_in"`
}

type WechatNotifer

type WechatNotifer struct {
	CorpID   string
	Secret   string
	AgentID  string
	Template map[string]*WechatTmpl
	Logger   *zap.Logger
	// contains filtered or unexported fields
}

func (*WechatNotifer) PostInit

func (wn *WechatNotifer) PostInit() error

func (*WechatNotifer) Send

func (wn *WechatNotifer) Send(tmpl string, data map[string]interface{}) error

type WechatTmpl

type WechatTmpl struct {
	Receivers map[string]string
	Content   string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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