Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers provides SlackBot management REST API, implementing app.CustomHandler
func NewHandlers ¶
func NewHandlers( repo repositories.SlackBotRepository, baseURL string, defaultSigningSecret string, ) *Handlers
NewHandlers creates a new SlackBot Handlers instance (management API only). Socket Mode event handling is managed separately by SlackSocketManager.
type SlackSocketManager ¶ added in v1.271.0
type SlackSocketManager struct {
// contains filtered or unexported fields
}
SlackSocketManager discovers registered SlackBots and manages one leader-elected socket worker per bot group:
- "default": all bots with no custom bot token secret
- <slackbot-id>: each bot with a custom BotTokenSecretName
func NewSlackSocketManager ¶ added in v1.271.0
func NewSlackSocketManager( kubeClient kubernetes.Interface, namespace string, repo repoports.SlackBotRepository, eventHandler *controllers.SlackBotEventHandler, channelResolver *services.SlackChannelResolver, cfg SlackSocketManagerConfig, ) *SlackSocketManager
NewSlackSocketManager creates a new SlackSocketManager
func (*SlackSocketManager) Run ¶ added in v1.271.0
func (m *SlackSocketManager) Run(ctx context.Context)
Run starts the reconciliation loop. On each tick, it discovers SlackBots and starts/stops leader-elected socket workers.
func (*SlackSocketManager) Stop ¶ added in v1.271.0
func (m *SlackSocketManager) Stop()
Stop cancels all running workers
type SlackSocketManagerConfig ¶ added in v1.271.0
type SlackSocketManagerConfig struct {
DefaultAppTokenSecretName string
DefaultAppTokenSecretKey string
DefaultBotTokenSecretName string
DefaultBotTokenSecretKey string
ReconcileInterval time.Duration
LeaderElectionConfig schedule.LeaderElectionConfig
}
SlackSocketManagerConfig holds configuration for SlackSocketManager
type SlackSocketWorker ¶ added in v1.271.0
type SlackSocketWorker struct {
// contains filtered or unexported fields
}
SlackSocketWorker manages one Socket Mode WebSocket connection for a Slack App. For the "default" group (bots with no custom token), botID is "default". For custom bots, botID is the SlackBot entity ID.
func NewSlackSocketWorker ¶ added in v1.271.0
func NewSlackSocketWorker( botID string, appTokenSecretName string, appTokenSecretKey string, botTokenSecretName string, botTokenSecretKey string, channelResolver *services.SlackChannelResolver, eventHandler *controllers.SlackBotEventHandler, ) *SlackSocketWorker
NewSlackSocketWorker creates a new SlackSocketWorker
func (*SlackSocketWorker) Run ¶ added in v1.271.0
func (w *SlackSocketWorker) Run(ctx context.Context)
Run connects to Slack via Socket Mode and processes events until ctx is cancelled. The Slack SDK handles reconnection automatically.