slack

package
v0.0.0-...-8dc1090 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Post

func Post(url string, msg WebhookMessage) error

Post posts the given WebhookMessage to the given webhook URL.

Types

type WebhookAttachment

type WebhookAttachment struct {
	Fallback   string         `json:"fallback"`
	Color      string         `json:"color"`
	Title      string         `json:"title"`
	Text       string         `json:"text"`
	Fields     []WebhookField `json:"fields"`
	MarkdownIn []string       `json:"mrkdwn_in"`
	ImageURL   string         `json:"image_url"`
}

A WebhookAttachment is an attachment for a Slack webhook message.

type WebhookField

type WebhookField struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

A WebhookField is a key-value field for a Slack webhook attachment.

type WebhookMessage

type WebhookMessage struct {
	Attachments []WebhookAttachment `json:"attachments"`
}

A WebhookMessage is a message sent to a Slack webhook URL.

Jump to

Keyboard shortcuts

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