Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ParseStyleFull = ParseStyle("full") ParseStyleNone = ParseStyle("none") )
View Source
var ( MarkdownFieldPretext = MarkdownField("pretext") MarkdownFieldText = MarkdownField("text") MarkdownFieldTitle = MarkdownField("title") MarkdownFieldFields = MarkdownField("fields") MarkdownFieldFallback = MarkdownField("fallback") )
View Source
var Robots = make(map[string][]Robot)
Robots is the map of registered command to robot
Functions ¶
func RegisterRobot ¶
RegisterRobot registers a robot in the Robots map with
Types ¶
type Attachment ¶
type Attachment struct { Fallback string `json:"fallback"` Pretext string `json:"pretext,omitempty"` Text string `json:"text,omitempty"` Color string `json:"color,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Fields []AttachmentField `json:"fields,omitempty"` MarkdownIn []MarkdownField `json:"mrkdown_in,omitempty"` }
type AttachmentField ¶
type IncomingWebhook ¶
type IncomingWebhook struct { Domain string `json:"domain"` Channel string `json:"channel"` Username string `json:"username"` Text string `json:"text"` IconEmoji string `json:"icon_emoji,omitempty"` IconURL string `json:"icon_url,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` UnfurlLinks bool `json:"unfurl_links,omitempty"` Parse ParseStyle `json:"parse,omitempty"` LinkNames bool `json:"link_names,omitempty"` Markdown bool `json:"mrkdwn,omitempty"` }
func (*IncomingWebhook) Send ¶
func (i *IncomingWebhook) Send() error
Send uses the IncomingWebhook API to post a message to a slack channel
type MarkdownField ¶
type MarkdownField string
type OutgoingWebHook ¶
type OutgoingWebHookResponse ¶
type OutgoingWebHookResponse struct { Text string `json:"text"` Parse ParseStyle `json:"parse,omitempty"` LinkNames bool `json:"link_names,omitempty"` Markdown bool `json:"mrkdwn,omitempty"` }
type ParseStyle ¶
type ParseStyle string
type Payload ¶
type Payload struct { Token string `schema:"token"` TeamID string `schema:"team_id"` TeamDomain string `schema:"team_domain,omitempty"` ChannelID string `schema:"channel_id"` ChannelName string `schema:"channel_name"` Timestamp float64 `schema:"timestamp,omitempty"` UserID string `schema:"user_id"` UserName string `schema:"user_name"` Text string `schema:"text,omitempty"` TriggerWord string `schema:"trigger_word,omitempty"` ServiceID string `schema:"service_id,omitempty"` Robot string }