Version: v0.0.0-...-9a151fe Latest Latest

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0




This section is empty.


View Source
var THEME_COLOR = "4f46e5"


func Post

func Post(webhookType string, context WebhookContext) error


type DingTalkReceiver

type DingTalkReceiver struct {

type DingTalkWebhook

type DingTalkWebhook struct {
	MessageType string                  `json:"msgtype"`
	Markdown    DingTalkWebhookMarkdown `json:"markdown"`

type DingTalkWebhookMarkdown

type DingTalkWebhookMarkdown struct {
	Title string `json:"title"`
	Text  string `json:"text"`

type DingTalkWebhookResponse

type DingTalkWebhookResponse struct {
	ErrorCode    int    `json:"errcode"`
	ErrorMessage string `json:"errmsg"`

type DiscordReceiver

type DiscordReceiver struct {

type DiscordWebhook

type DiscordWebhook struct {
	EmbedList []DiscordWebhookEmbed `json:"embeds"`

type DiscordWebhookEmbed

type DiscordWebhookEmbed struct {
	Title       string                     `json:"title"`
	Type        string                     `json:"type"`
	Description string                     `json:"description,omitempty"`
	URL         string                     `json:"url,omitempty"`
	Timestamp   string                     `json:"timestamp"`
	Author      DiscordWebhookEmbedAuthor  `json:"author"`
	FieldList   []DiscordWebhookEmbedField `json:"fields,omitempty"`

type DiscordWebhookEmbedAuthor

type DiscordWebhookEmbedAuthor struct {
	Name string `json:"name"`

type DiscordWebhookEmbedField

type DiscordWebhookEmbedField struct {
	Name  string `json:"name"`
	Value string `json:"value"`

type DiscordWebhookResponse

type DiscordWebhookResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`

type FeishuReceiver

type FeishuReceiver struct {

type FeishuWebhook

type FeishuWebhook struct {
	MessageType string               `json:"msg_type"`
	Content     FeishuWebhookContent `json:"content"`

type FeishuWebhookContent

type FeishuWebhookContent struct {
	Post FeishuWebhookPostLanguage `json:"post"`

type FeishuWebhookPost

type FeishuWebhookPost struct {
	Title       string                       `json:"title"`
	ContentList [][]FeishuWebhookPostSection `json:"content"`

type FeishuWebhookPostLanguage

type FeishuWebhookPostLanguage struct {
	English FeishuWebhookPost `json:"en_us"`

type FeishuWebhookPostLine

type FeishuWebhookPostLine struct {
	SectionList []FeishuWebhookPostSection `json:""`

type FeishuWebhookPostSection

type FeishuWebhookPostSection struct {
	Tag  string `json:"tag"`
	Text string `json:"text"`
	Href string `json:"href,omitempty"`

type FeishuWebhookResponse

type FeishuWebhookResponse struct {
	Code    int    `json:"code"`
	Message string `json:"msg"`

type SlackReceiver

type SlackReceiver struct {

type SlackWebhook

type SlackWebhook struct {
	Text      string              `json:"text"`
	BlockList []SlackWebhookBlock `json:"blocks"`

type SlackWebhookBlock

type SlackWebhookBlock struct {
	Type        string                     `json:"type"`
	Text        *SlackWebhookBlockMarkdown `json:"text,omitempty"`
	ElementList []SlackWebhookElement      `json:"elements,omitempty"`

type SlackWebhookBlockMarkdown

type SlackWebhookBlockMarkdown struct {
	Type string `json:"type"`
	Text string `json:"text"`

type SlackWebhookElement

type SlackWebhookElement struct {
	Type   string                    `json:"type"`
	Button SlackWebhookElementButton `json:"text,omitempty"`
	URL    string                    `json:"url,omitempty"`

type SlackWebhookElementButton

type SlackWebhookElementButton struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`

type TeamsReceiver

type TeamsReceiver struct {

type TeamsWebhook

type TeamsWebhook struct {
	Type        string                `json:"@type"`
	Context     string                `json:"@context"`
	Summary     string                `json:"summary"`
	ThemeColor  string                `json:"themeColor"`
	Title       string                `json:"title"`
	SectionList []TeamsWebhookSection `json:"sections"`
	ActionList  []TeamsWebhookAction  `json:"potentialAction"`

type TeamsWebhookAction

type TeamsWebhookAction struct {
	Type       string                     `json:"@type"`
	Name       string                     `json:"name"`
	TargetList []TeamsWebhookActionTarget `json:"targets"`

type TeamsWebhookActionTarget

type TeamsWebhookActionTarget struct {
	OS  string `json:"os"`
	URI string `json:"uri"`

type TeamsWebhookSection

type TeamsWebhookSection struct {
	ActivityTitle    string                    `json:"activityTitle"`
	ActivitySubtitle string                    `json:"activitySubtitle"`
	FactList         []TeamsWebhookSectionFact `json:"facts"`
	Text             string                    `json:"text"`

type TeamsWebhookSectionFact

type TeamsWebhookSectionFact struct {
	Name  string `json:"name"`
	Value string `json:"value"`

type WeComReceiver

type WeComReceiver struct {

type WeComWebhook

type WeComWebhook struct {
	MessageType string               `json:"msgtype"`
	Markdown    WeComWebhookMarkdown `json:"markdown"`

type WeComWebhookMarkdown

type WeComWebhookMarkdown struct {
	Content string `json:"content"`

type WeComWebhookResponse

type WeComWebhookResponse struct {
	ErrorCode    int    `json:"errcode"`
	ErrorMessage string `json:"errmsg"`

type WebhookContext

type WebhookContext struct {
	URL          string
	Level        WebhookLevel
	Title        string
	Description  string
	Link         string
	CreatorName  string
	CreatorEmail string
	CreatedTs    int64
	MetaList     []WebhookMeta

type WebhookLevel

type WebhookLevel string
const (
	WebhookInfo    WebhookLevel = "INFO"
	WebhookSuccess WebhookLevel = "SUCCESS"
	WebhookWarn    WebhookLevel = "WARN"
	WebhookError   WebhookLevel = "ERROR"

type WebhookMeta

type WebhookMeta struct {
	Name  string
	Value string

type WebhookReceiver

type WebhookReceiver interface {
	// contains filtered or unexported methods

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL