controllers

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateIssueAction          = "issue_create"
	CreateIssueModal           = "issue_create_modal"
	MoveIssueAction            = "issue_move"
	MoveIssueModal             = "issue_move_modal"
	ViewIssueAction            = "view_issue_details"
	ViewIssueActionModal       = "view_issue_details_modal" // #nosec G101
	ConfirmWebhookModal        = "confirm_webhook_modal"
	WebhookActionIDPrefix      = "webhook_action"
	OptionButtonActionIDPrefix = "option_button_action"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FifoQueueProducer

type FifoQueueProducer interface {
	Send(ctx context.Context, slackChannelID, dedupID, body string) error
}

type IssueFinder

type IssueFinder interface {
	FindIssueBySlackPost(ctx context.Context, channelID string, slackPostID string, includeArchived bool) *models.Issue
}

type SlackAPIClient

type SlackAPIClient interface {
	PostEphemeral(ctx context.Context, channelID, userID string, options ...slackapi.MsgOption) (string, error)
	GetUserInfo(ctx context.Context, user string) (*slackapi.User, error)
	UserIsInGroup(ctx context.Context, groupID, userID string) bool
	SendResponse(ctx context.Context, channelID, responseURL, responseType, text string) error
	OpenModal(ctx context.Context, triggerID string, request slackapi.ModalViewRequest) error
	IsAlertChannel(ctx context.Context, channelID string) (bool, string, error)
}

type SocketModeClient

type SocketModeClient interface {
	Ack(req socketmode.Request, payload ...any)
	RunContext(ctx context.Context) error
	Events() chan socketmode.Event
}

SocketModeClient defines the interface for the SocketMode client used by the handlers.

type SocketModeHandler

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

SocketModeHandler handles Slack Socket Mode events and interactions.

func NewSocketModeHandler

func NewSocketModeHandler(apiClient SlackAPIClient, socketModeClient SocketModeClient, commandQueue FifoQueueProducer, issueFinder IssueFinder,
	cacheStore store.StoreInterface, cfg *config.ManagerConfig, managerSettings *models.ManagerSettingsWrapper, logger types.Logger,
) *SocketModeHandler

NewSocketModeHandler creates a new SocketModeHandler.

func (*SocketModeHandler) RunEventLoop

func (r *SocketModeHandler) RunEventLoop(ctx context.Context) error

RunEventLoop starts the Socket Mode event loop. It blocks until the context is cancelled or an error occurs. During graceful shutdown, it waits for all in-flight handlers to complete up to the configured drain timeout.

type SocketModeHandlerFunc

type SocketModeHandlerFunc func(context.Context, *socketmode.Event, SocketModeClient)

SocketModeHandlerFunc defines a function to handle socketmode events.

Jump to

Keyboard shortcuts

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