slack

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package slack delivers Console events to a Slack channel via an Incoming Webhook URL. Incoming Webhooks need no bot token or scopes — just the URL — which keeps setup trivial for self-hosters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	// WebhookURL is the Slack Incoming Webhook endpoint.
	WebhookURL string
	// HTTP issues the POST. If nil, a client with a sane timeout is used.
	HTTP *http.Client
}

Notifier posts events to a Slack Incoming Webhook.

func New

func New(webhookURL string, opts ...Option) *Notifier

New builds a Slack notifier for the given Incoming Webhook URL.

func (*Notifier) Name

func (n *Notifier) Name() string

Name identifies the sink.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, ev core.Event) error

Notify posts ev to the configured webhook as a colored attachment.

type Option

type Option func(*Notifier)

Option configures a Notifier.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the HTTP client.

Jump to

Keyboard shortcuts

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