slack

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package slack provides a notifier.Transport implementation for sending notifications to Slack

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type RichNotification

type RichNotification interface {
	common.Notification
	// GetSlackOptions returns the slack.MsgOptions to be used when sending the notification
	GetSlackOptions() []slack.MsgOption
}

RichNotification is an optional interface that can be implemented by any notification supporting Slack formatting

type Transport

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

Transport supports sending messages to Slack

func NewTransport

func NewTransport(key common.TransportKey, token string, opts ...slack.Option) *Transport

NewTransport creates a new Slack Transport It requires a TransportID, a Slack API token, and optionally some slack.Options

func (*Transport) Key

func (s *Transport) Key() common.TransportKey

func (*Transport) Push

func (s *Transport) Push(ctx context.Context, notification common.Notification) error

Push sends a notification to a Slack user In addition to supporting common.Notification, it also supports RichNotification for more complex messages that might include attachments, blocks, etc.

func (*Transport) Validate

func (s *Transport) Validate(ctx context.Context) error

Jump to

Keyboard shortcuts

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