Documentation
¶
Index ¶
- func NewIncomingWebhookServer(log logrus.FieldLogger, cfg *config.Config, dispatcher *Dispatcher, ...) *httpx.Server
- type ActionProvider
- type AnalyticsReporter
- type Dispatcher
- type ExternalRequestDispatch
- type IncomingWebhookData
- type PluginDispatch
- type Scheduler
- type StartedSource
- type StartedSources
- type StateObserver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIncomingWebhookServer ¶
func NewIncomingWebhookServer(log logrus.FieldLogger, cfg *config.Config, dispatcher *Dispatcher, startedSources map[string]StartedSources) *httpx.Server
NewIncomingWebhookServer creates a new HTTP server for incoming webhooks.
Types ¶
type ActionProvider ¶
type ActionProvider interface {
RenderedActions(data any, sourceBindings []string) ([]action.Action, error)
ExecuteAction(ctx context.Context, action action.Action) interactive.CoreMessage
}
ActionProvider defines a provider that is responsible for automated actions.
type AnalyticsReporter ¶
type AnalyticsReporter interface {
// ReportHandledEventSuccess reports a successfully handled event using a given integration type, communication platform, and plugin.
ReportHandledEventSuccess(event analytics.ReportEventInput) error
// ReportHandledEventError reports a failure while handling event using a given integration type, communication platform, and plugin.
ReportHandledEventError(event analytics.ReportEventInput, err error) error
// ReportFatalError reports a fatal app error.
ReportFatalError(err error) error
// Close cleans up the reporter resources.
Close() error
}
AnalyticsReporter defines a reporter that collects analytics data.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher provides functionality to starts a given plugin, watches for incoming events and calling all notifiers to dispatch received event.
func NewDispatcher ¶
func NewDispatcher(log logrus.FieldLogger, clusterName string, notifiers map[string]bot.Bot, sinkNotifiers []notifier.Sink, manager *plugin.Manager, actionProvider ActionProvider, reporter AnalyticsReporter, auditReporter audit.AuditReporter, restCfg *rest.Config) *Dispatcher
NewDispatcher create a new Dispatcher instance.
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(dispatch PluginDispatch) error
Dispatch starts a given plugin, watches for incoming events and calling all notifiers to dispatch received event.
func (*Dispatcher) DispatchExternalRequest ¶
func (d *Dispatcher) DispatchExternalRequest(dispatch ExternalRequestDispatch) error
DispatchExternalRequest dispatches a single message for a given plugin.
func (*Dispatcher) WithStateObserver ¶
func (d *Dispatcher) WithStateObserver(observer StateObserver) *Dispatcher
WithStateObserver sets the observer notified about every dispatched event.
type ExternalRequestDispatch ¶
type ExternalRequestDispatch struct {
PluginDispatch
// contains filtered or unexported fields
}
ExternalRequestDispatch is a wrapper for PluginDispatch that holds the payload for external request.
type IncomingWebhookData ¶
type IncomingWebhookData struct {
// contains filtered or unexported fields
}
IncomingWebhookData holds information about incoming webhook.
func (IncomingWebhookData) FullURLForSource ¶
func (w IncomingWebhookData) FullURLForSource(sourceName string) string
type PluginDispatch ¶
type PluginDispatch struct {
// contains filtered or unexported fields
}
PluginDispatch holds information about source plugin.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler analyzes the provided configuration and based on that schedules plugin sources.
func NewScheduler ¶
func NewScheduler(ctx context.Context, log logrus.FieldLogger, cfg *config.Config, dispatcher pluginDispatcher, schedulerChan chan string) *Scheduler
NewScheduler create a new Scheduler instance.
func (*Scheduler) StartedSourcePlugins ¶
func (d *Scheduler) StartedSourcePlugins() map[string]StartedSources
type StartedSource ¶
type StartedSource struct {
SourceDisplayName string
PluginName string
PluginConfig *source.Config
IsInteractivitySupported bool
}
StartedSource holds information about started source plugin.
type StartedSources ¶
type StartedSources map[bool]StartedSource
StartedSources holds information about started source plugins grouped by interactivity supported.
type StateObserver ¶
type StateObserver interface {
// ObserveEvent is called for every dispatched event. Implementations must not block, as this
// runs on the event delivery path.
ObserveEvent(pluginName string, rawObject any)
}
StateObserver observes dispatched events to maintain a derived view of the cluster state. It is optional: when nil, events are dispatched exactly as before.