slack

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

Slack struct holds necessary data to communicate with the Slack API.

func New

func New(apiToken string) *Slack

New returns a new instance of a Slack notification service. For more information about slack api token:

-> https://pkg.go.dev/github.com/slack-go/slack#New

func (*Slack) AddReceivers

func (s *Slack) AddReceivers(channelIDs ...string)

AddReceivers takes Slack channel IDs and adds them to the internal channel ID list. The Send method will send a given message to all those channels.

func (Slack) Send

func (s Slack) Send(ctx context.Context, subject, message string) error

Send takes a message subject and a message body and sends them to all previously set channels. you will need a slack app with the chat:write.public and chat:write permissions. see https://api.slack.com/

Jump to

Keyboard shortcuts

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