Documentation ¶
Index ¶
- Constants
- type Attachment
- type SimpleSlackRequest
- type SlackClient
- func (sc SlackClient) SendError(message string, options ...string) (err error)
- func (sc SlackClient) SendInfo(message string, options ...string) (err error)
- func (sc SlackClient) SendJobNotification(job SlackJobNotification) error
- func (sc SlackClient) SendSlackNotification(sr SimpleSlackRequest) error
- func (sc SlackClient) SendWarning(message string, options ...string) (err error)
- type SlackJobNotification
- type SlackMessage
Constants ¶
View Source
const DefaultSlackTimeout = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Color string `json:"color,omitempty"` Fallback string `json:"fallback,omitempty"` CallbackID string `json:"callback_id,omitempty"` ID int `json:"id,omitempty"` AuthorID string `json:"author_id,omitempty"` AuthorName string `json:"author_name,omitempty"` AuthorSubname string `json:"author_subname,omitempty"` AuthorLink string `json:"author_link,omitempty"` AuthorIcon string `json:"author_icon,omitempty"` Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Pretext string `json:"pretext,omitempty"` Text string `json:"text,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` // Fields and actions are not defined. MarkdownIn []string `json:"mrkdwn_in,omitempty"` Ts json.Number `json:"ts,omitempty"` }
type SimpleSlackRequest ¶
type SlackClient ¶
func NewSlackClient ¶ added in v1.18.9
func NewSlackClient(configuration settings.IConfiguration) *SlackClient
func (SlackClient) SendError ¶
func (sc SlackClient) SendError(message string, options ...string) (err error)
func (SlackClient) SendInfo ¶
func (sc SlackClient) SendInfo(message string, options ...string) (err error)
func (SlackClient) SendJobNotification ¶
func (sc SlackClient) SendJobNotification(job SlackJobNotification) error
func (SlackClient) SendSlackNotification ¶
func (sc SlackClient) SendSlackNotification(sr SimpleSlackRequest) error
SendSlackNotification will post to an 'Incoming Webook' url setup in Slack Apps. It accepts some text and the slack channel is saved within Slack.
func (SlackClient) SendWarning ¶
func (sc SlackClient) SendWarning(message string, options ...string) (err error)
type SlackJobNotification ¶
type SlackMessage ¶
type SlackMessage struct { Username string `json:"username,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` Channel string `json:"channel,omitempty"` Text string `json:"text,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` }
Click to show internal directories.
Click to hide internal directories.