slack

package
v1.5.31 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

type Payload struct {
	Channel   string `json:"channel,omitempty"`
	IconEmoji string `json:"icon_emoji,omitempty"`
	IconURL   string `json:"icon_url,omitempty"`
	Text      string `json:"text,omitempty"`
	Username  string `json:"username,omitempty"`
}

Payload holds information about the message we want to send. Any of these values except Text may be left empty to use the defaults for the Webhook. IconEmoji and IconURL are mutually exclusive, do not set both. https://api.slack.com/incoming-webhooks#posting_with_webhooks

type Provider

type Provider struct {
	Debug      bool
	Payload    Payload
	WebhookURL string
}

Provider provides an interface to interact with the Slack Webhook API

func New

func New(webhookURL string) Provider

New creates a new invocation of this Provider wrapper

func (*Provider) Send

func (a *Provider) Send() error

Send sends a message to Slack

func (*Provider) SendText

func (a *Provider) SendText(text string) error

SendText sets message text and sends the message, a convenience wrapper for SetText and Send

func (*Provider) SetText

func (a *Provider) SetText(text string)

SetText sets the message text, i.e. what will be displayed in the Slack window

Jump to

Keyboard shortcuts

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