source

package
v1.6.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIncomingWebhookServer added in v1.4.0

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 added in v1.0.0

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 added in v1.0.0

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. Once we will have the gRPC contract established with proper Cloud Event schema, we should move also this logic here: https://github.com/kubeshop/botkube/blob/525c737956ff820a09321879284037da8bf5d647/pkg/controller/controller.go#L200-L253

func (*Dispatcher) DispatchExternalRequest added in v1.4.0

func (d *Dispatcher) DispatchExternalRequest(dispatch ExternalRequestDispatch) error

DispatchExternalRequest dispatches a single message for a given plugin.

type ExternalRequestDispatch added in v1.4.0

type ExternalRequestDispatch struct {
	PluginDispatch
	// contains filtered or unexported fields
}

ExternalRequestDispatch is a wrapper for PluginDispatch that holds the payload for external request.

type IncomingWebhookData added in v1.4.0

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

IncomingWebhookData holds information about incoming webhook.

func (IncomingWebhookData) FullURLForSource added in v1.4.0

func (w IncomingWebhookData) FullURLForSource(sourceName string) string

type PluginDispatch added in v1.0.0

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) Start

func (d *Scheduler) Start(ctx context.Context) error

Start starts all sources and dispatch received events.

func (*Scheduler) StartedSourcePlugins added in v1.4.0

func (d *Scheduler) StartedSourcePlugins() map[string]StartedSources

type StartedSource added in v1.4.0

type StartedSource struct {
	SourceDisplayName        string
	PluginName               string
	PluginConfig             *source.Config
	IsInteractivitySupported bool
}

StartedSource holds information about started source plugin.

type StartedSources added in v1.4.0

type StartedSources map[bool]StartedSource

StartedSources holds information about started source plugins grouped by interactivity supported.

Jump to

Keyboard shortcuts

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