interactions

package
v0.0.0-...-388220c Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Handle(callback *slack.InteractionCallback, logger *logrus.Entry) (output []byte, err error)
	Identifier() string
}

Handler knows how to handle an interaction callback, optionally returning a response body to be sent back to Slack.

func HandlerFromPartial

func HandlerFromPartial(handler PartialHandler) Handler

HandlerFromPartial adapts a partial handler to a singleton when there is just one handler for a callback

func HandlerFunc

func HandlerFunc(identifier string, handle func(callback *slack.InteractionCallback, logger *logrus.Entry) (output []byte, err error)) Handler

HandlerFunc returns a Handler for a handling func

func MultiHandler

func MultiHandler(handlers ...PartialHandler) Handler

MultiHandler sends the callback to a chain of partial handlers, greedily allowing them to consume and respond to it.

type PartialHandler

type PartialHandler interface {
	Handle(callback *slack.InteractionCallback, logger *logrus.Entry) (handled bool, output []byte, err error)
	Identifier() string
}

PartialHandler is a Handler that exposes whether it handled a callback, consuming it, or if another Handler should have the chance to handle it instead.

func PartialFromHandler

func PartialFromHandler(handler Handler) PartialHandler

PartialFromHandler adapts a handler to a partial and always expects that the handler consumes the callback

func PartialHandlerFunc

func PartialHandlerFunc(identifier string, handle func(callback *slack.InteractionCallback, logger *logrus.Entry) (handled bool, output []byte, err error)) PartialHandler

PartialHandlerFunc returns a PartialHandler for a handling func

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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