handler

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RealSlackHandler

type RealSlackHandler struct {
	NotificationChannel    string
	ReactionThreshold      int
	Database               database.Database
	SlackClient            SlackClient
	SlackVerificationToken string
}

func (*RealSlackHandler) HandleEvent

func (sh *RealSlackHandler) HandleEvent(body []byte) (SlackHandlerResponse, error)

func (*RealSlackHandler) SendMessage

func (sh *RealSlackHandler) SendMessage(channel string, msg string) error

type SlackChannelLeaver

type SlackChannelLeaver interface {
	LeaveConversation(string) (bool, error)
}

type SlackClient

type SlackClient interface {
	SlackChannelLeaver
	SendMessage(string, ...slack.MsgOption) (string, string, string, error)
	GetPermalink(*slack.PermalinkParameters) (string, error)
}

type SlackHandler

type SlackHandler interface {
	HandleEvent([]byte) (SlackHandlerResponse, error)
	SendMessage(string, string) error
}

func NewRealSlackHandler

func NewRealSlackHandler(db database.Database, slackClient SlackClient, notificationChannel string, reacitonThreshold int, verificationToken string) SlackHandler

type SlackHandlerResponse

type SlackHandlerResponse struct {
	StatusCode int
	Body       []byte
	Headers    map[string]string
}

Jump to

Keyboard shortcuts

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