interaction

package
v0.1.65 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName   = "slack_interaction"
	InteractionPort = "interaction"
	ErrorPort       = "error"
	RequestPort     = "request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

Component implements the Slack interaction receiver

func (*Component) GetInfo

func (c *Component) GetInfo() module.ComponentInfo

func (*Component) Handle

func (c *Component) Handle(ctx context.Context, handler module.Handler, port string, msg any) any

func (*Component) Instance

func (c *Component) Instance() module.Component

func (*Component) Ports

func (c *Component) Ports() []module.Port

type Context

type Context any

Context type alias for schema generation

type Error

type Error struct {
	Context Context `json:"context,omitempty" configurable:"true" title:"Context"`
	Error   string  `json:"error" title:"Error"`
}

Error output

type Header struct {
	Key   string `json:"key" required:"true" title:"Key"`
	Value string `json:"value" required:"true" title:"Value"`
}

Header matches HTTP Server's header format

type Interaction

type Interaction struct {
	Context     Context `json:"context,omitempty" configurable:"true" title:"Context"`
	ActionID    string  `json:"actionId" title:"Action ID" description:"Button action identifier (e.g. logs, restart)"`
	ActionValue string  `json:"actionValue" title:"Action Value" description:"Value embedded in the button"`
	UserID      string  `json:"userId" title:"User ID" description:"Slack user ID who clicked"`
	UserName    string  `json:"userName" title:"User Name" description:"Slack username who clicked"`
	ChannelID   string  `json:"channelId" title:"Channel ID" description:"Channel where interaction happened"`
	ResponseURL string  `json:"responseUrl" format:"uri" title:"Response URL" description:"URL to send follow-up messages"`
	TriggerID   string  `json:"triggerId" title:"Trigger ID" description:"ID for opening modals"`
}

Interaction is the parsed Block Kit interaction payload

type Request

type Request struct {
	Context Context `json:"context,omitempty" configurable:"true" title:"Context" description:"Arbitrary context to pass through to output"`

	// Credentials - from edge config
	SigningSecret string `` /* 127-byte string literal not displayed */
	SkipVerify    bool   `json:"skipVerify,omitempty" configurable:"true" title:"Skip Verify" description:"Skip signature verification (for testing)"`

	// HTTP request data - matches HTTP Server Request format
	RequestURI string   `json:"requestURI,omitempty" title:"Request URI"`
	Method     string   `json:"method,omitempty" title:"Method"`
	Headers    []Header `json:"headers,omitempty" title:"Headers" description:"HTTP headers from the request"`
	Body       string   `json:"body" required:"true" title:"Body" description:"Raw request body"`
}

Request is compatible with HTTP Server's Request output

type Settings

type Settings struct {
	EnableErrorPort bool `json:"enableErrorPort" title:"Enable Error Port" description:"Output errors to error port instead of failing"`
}

Settings configures the component - only port flags

Jump to

Keyboard shortcuts

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