notice

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotifyWxTypeText     = "text"
	NotifyWxTypeMarkdown = "markdown"
	NotifyUrlWx          = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=%s"
)

Variables

View Source
var (
	DefaultKey = ""
)

Functions

func SendNotifyDiscord

func SendNotifyDiscord(webhook, content string) error

func SendNotifyWx

func SendNotifyWx(msgType, msg, key string) error

func SendNotifyWxCallFuncErr

func SendNotifyWxCallFuncErr(key, funcName, errInfo, keyInfo string) error

Types

type Author

type Author struct {
	Name    string `json:"name"`
	URL     string `json:"url"`
	IconURL string `json:"icon_url"`
}

type Embed

type Embed struct {
	Author      Author  `json:"author"`
	Title       string  `json:"title"`
	URL         string  `json:"url"`
	Description string  `json:"description"`
	Color       int64   `json:"color"`
	Fields      []Field `json:"fields"`
	Thumbnail   Image   `json:"thumbnail"`
	Image       Image   `json:"image"`
	Footer      Footer  `json:"footer"`
}

type Field

type Field struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}
type Footer struct {
	Text    string `json:"text"`
	IconURL string `json:"icon_url"`
}

type Image

type Image struct {
	URL string `json:"url"`
}

type NotifyContent

type NotifyContent struct {
	Content string `json:"content"`
}

type NotifyDataWx

type NotifyDataWx struct {
	MsgType  string        `json:"msgtype"`
	Markdown NotifyContent `json:"markdown"`
	Text     NotifyContent `json:"text"`
}

type Webhook

type Webhook struct {
	Username  string  `json:"username"`
	AvatarURL string  `json:"avatar_url"`
	Content   string  `json:"content"`
	Embeds    []Embed `json:"embeds"`
}

Jump to

Keyboard shortcuts

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