Documentation
¶
Index ¶
- func Post(webhookType string, context Context) error
- type Context
- type DingTalkReceiver
- type DingTalkWebhook
- type DingTalkWebhookMarkdown
- type DingTalkWebhookResponse
- type DiscordReceiver
- type DiscordWebhook
- type DiscordWebhookEmbed
- type DiscordWebhookEmbedAuthor
- type DiscordWebhookEmbedField
- type DiscordWebhookResponse
- type FeishuReceiver
- type FeishuWebhook
- type FeishuWebhookContent
- type FeishuWebhookPost
- type FeishuWebhookPostLanguage
- type FeishuWebhookPostLine
- type FeishuWebhookPostSection
- type FeishuWebhookResponse
- type Level
- type Meta
- type Receiver
- type SlackReceiver
- type SlackWebhook
- type SlackWebhookBlock
- type SlackWebhookBlockMarkdown
- type SlackWebhookElement
- type SlackWebhookElementButton
- type TeamsReceiver
- type TeamsWebhook
- type TeamsWebhookAction
- type TeamsWebhookActionTarget
- type TeamsWebhookSection
- type TeamsWebhookSectionFact
- type WeComReceiver
- type WeComWebhook
- type WeComWebhookMarkdown
- type WeComWebhookResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { URL string Level Level Title string Description string Link string CreatorName string CreatorEmail string CreatedTs int64 MetaList []Meta }
Context is the context of webhook.
type DingTalkReceiver ¶
type DingTalkReceiver struct { }
DingTalkReceiver is the receiver for DingTalk.
type DingTalkWebhook ¶
type DingTalkWebhook struct { MessageType string `json:"msgtype"` Markdown DingTalkWebhookMarkdown `json:"markdown"` }
DingTalkWebhook is the API message for DingTalk webhook.
type DingTalkWebhookMarkdown ¶
DingTalkWebhookMarkdown is the API message for DingTalk webhook markdown.
type DingTalkWebhookResponse ¶
type DingTalkWebhookResponse struct { ErrorCode int `json:"errcode"` ErrorMessage string `json:"errmsg"` }
DingTalkWebhookResponse is the API message for DingTalk webhook response.
type DiscordWebhook ¶
type DiscordWebhook struct {
EmbedList []DiscordWebhookEmbed `json:"embeds"`
}
DiscordWebhook is the API message for Discord webhook.
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"` }
DiscordWebhookEmbed is the API message for Discord webhook embed.
type DiscordWebhookEmbedAuthor ¶
type DiscordWebhookEmbedAuthor struct {
Name string `json:"name"`
}
DiscordWebhookEmbedAuthor is the API message for Discord webhook embed Author.
type DiscordWebhookEmbedField ¶
DiscordWebhookEmbedField is the API message for Discord webhook embed field.
type DiscordWebhookResponse ¶
DiscordWebhookResponse is the API message for Discord webhook response.
type FeishuWebhook ¶
type FeishuWebhook struct { MessageType string `json:"msg_type"` Content FeishuWebhookContent `json:"content"` }
FeishuWebhook is the API message for Feishu webhook.
type FeishuWebhookContent ¶
type FeishuWebhookContent struct {
Post FeishuWebhookPostLanguage `json:"post"`
}
FeishuWebhookContent is the API message for Feishu webhook content.
type FeishuWebhookPost ¶
type FeishuWebhookPost struct { Title string `json:"title"` ContentList [][]FeishuWebhookPostSection `json:"content"` }
FeishuWebhookPost is the API message for Feishu webhook POST.
type FeishuWebhookPostLanguage ¶
type FeishuWebhookPostLanguage struct {
English FeishuWebhookPost `json:"en_us"`
}
FeishuWebhookPostLanguage is the API message for Feishu webhook POST language.
type FeishuWebhookPostLine ¶
type FeishuWebhookPostLine struct {
SectionList []FeishuWebhookPostSection `json:""`
}
FeishuWebhookPostLine is the API message for Feishu webhook POST line.
type FeishuWebhookPostSection ¶
type FeishuWebhookPostSection struct { Tag string `json:"tag"` Text string `json:"text"` Href string `json:"href,omitempty"` }
FeishuWebhookPostSection is the API message for Feishu webhook POST section.
type FeishuWebhookResponse ¶
FeishuWebhookResponse is the API message for Feishu webhook response.
type Level ¶
type Level string
Level is the level of webhook.
const ( // WebhookInfo is the webhook level for INFO. WebhookInfo Level = "INFO" // WebhookSuccess is the webhook level for SUCCESS. WebhookSuccess Level = "SUCCESS" // WebhookWarn is the webhook level for WARN. WebhookWarn Level = "WARN" // WebhookError is the webhook level for ERROR. WebhookError Level = "ERROR" )
type Receiver ¶
type Receiver interface {
// contains filtered or unexported methods
}
Receiver is the webhook receiver.
type SlackWebhook ¶
type SlackWebhook struct { Text string `json:"text"` BlockList []SlackWebhookBlock `json:"blocks"` }
SlackWebhook is the API message for Slack webhook.
type SlackWebhookBlock ¶
type SlackWebhookBlock struct { Type string `json:"type"` Text *SlackWebhookBlockMarkdown `json:"text,omitempty"` ElementList []SlackWebhookElement `json:"elements,omitempty"` }
SlackWebhookBlock is the API message for Slack webhook block.
type SlackWebhookBlockMarkdown ¶
SlackWebhookBlockMarkdown is the API message for Slack webhook block markdown.
type SlackWebhookElement ¶
type SlackWebhookElement struct { Type string `json:"type"` Button SlackWebhookElementButton `json:"text,omitempty"` URL string `json:"url,omitempty"` }
SlackWebhookElement is the API message for Slack webhook element.
type SlackWebhookElementButton ¶
type SlackWebhookElementButton struct { Type string `json:"type"` Text string `json:"text,omitempty"` }
SlackWebhookElementButton is the API message for Slack webhook element button.
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"` }
TeamsWebhook is the API message for Teams webhook.
type TeamsWebhookAction ¶
type TeamsWebhookAction struct { Type string `json:"@type"` Name string `json:"name"` TargetList []TeamsWebhookActionTarget `json:"targets"` }
TeamsWebhookAction is the API message for Teams webhook action.
type TeamsWebhookActionTarget ¶
TeamsWebhookActionTarget is the API message for Teams webhook action target.
type TeamsWebhookSection ¶
type TeamsWebhookSection struct { ActivityTitle string `json:"activityTitle"` ActivitySubtitle string `json:"activitySubtitle"` FactList []TeamsWebhookSectionFact `json:"facts"` Text string `json:"text"` }
TeamsWebhookSection is the API message for Teams webhook section.
type TeamsWebhookSectionFact ¶
TeamsWebhookSectionFact is the API message for Teams webhook section fact.
type WeComWebhook ¶
type WeComWebhook struct { MessageType string `json:"msgtype"` Markdown WeComWebhookMarkdown `json:"markdown"` }
WeComWebhook is the API message for WeCom webhook.
type WeComWebhookMarkdown ¶
type WeComWebhookMarkdown struct {
Content string `json:"content"`
}
WeComWebhookMarkdown is the API message for WeCom webhook markdown.
type WeComWebhookResponse ¶
type WeComWebhookResponse struct { ErrorCode int `json:"errcode"` ErrorMessage string `json:"errmsg"` }
WeComWebhookResponse is the API message for WeCom webhook response.