slack

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(url string)

Initialize sets the webhook url of the slack request

func PostWebhook

func PostWebhook(msg *WebhookMessage) error

PostWebhook posts a WebhookMessage to slack

Types

type Attachment

type Attachment struct {
	Color      string   `json:"color,omitempty"`
	Title      string   `json:"title,omitempty"`
	TitleLink  string   `json:"title_link,omitempty"`
	Pretext    string   `json:"pretext,omitempty"`
	Text       string   `json:"text"`
	ImageURL   string   `json:"image_url,omitempty"`
	ThumbURL   string   `json:"thumb_url,omitempty"`
	MarkdownIn []string `json:"mrkdwn_in,omitempty"`
	Footer     string   `json:"footer,omitempty"`
	FooterIcon string   `json:"footer_icon,omitempty"`
}

Attachment contains the information needed for release note attachments

func (*Attachment) UsePullRequests

func (a *Attachment) UsePullRequests(prs []github.PullRequest)

UsePullRequests formats the data from pull requests and adds them to the attachment

type WebhookMessage

type WebhookMessage struct {
	Channel     string       `json:"channel"`
	Username    string       `json:"username,omitempty"`
	IconURL     string       `json:"icon_url,omitempty"`
	Text        string       `json:"text,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

WebhookMessage holds the message to send to slack

Jump to

Keyboard shortcuts

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