slackgw

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package slackgw implements the gateway.NotificationAdapter for Slack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements gateway.NotificationAdapter for Slack using Socket Mode. It also supports outbound messaging via Send and SendFile methods.

func New

func New(botToken, appToken string) *Adapter

New creates a new Slack adapter using Socket Mode.

func (*Adapter) Channels

func (a *Adapter) Channels() []gateway.ChannelInfo

Channels returns discovered channels.

func (*Adapter) HTTPHandler added in v0.2.1

func (a *Adapter) HTTPHandler() http.Handler

HTTPHandler returns nil since Slack uses Socket Mode, not webhooks.

func (*Adapter) Name

func (a *Adapter) Name() string

func (*Adapter) Send

func (a *Adapter) Send(ctx context.Context, channelID, sender, content string) error

Send delivers a message to a Slack channel.

func (*Adapter) SendFile

func (a *Adapter) SendFile(ctx context.Context, channelID, sender, filename string, data []byte, _ string) error

SendFile uploads a file to a Slack channel.

func (*Adapter) Start

func (a *Adapter) Start(ctx context.Context, handler func(gateway.Notification)) error

Start connects to Slack Socket Mode and forwards events as Notifications.

func (*Adapter) Status

func (a *Adapter) Status() gateway.AdapterStatus

Status returns the current connection state.

func (*Adapter) Stop

func (a *Adapter) Stop() error

Stop gracefully disconnects.

func (*Adapter) Type added in v0.2.1

func (a *Adapter) Type() gateway.AdapterType

Type returns AdapterSocket since Slack uses WebSocket via Socket Mode.

Jump to

Keyboard shortcuts

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