source

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.ReportEvent) error

	// ReportHandledEventError reports a failure while handling event using a given integration type, communication platform, and plugin.
	ReportHandledEventError(event analytics.ReportEvent, 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, 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

type PluginDispatch added in v1.0.0

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

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(log logrus.FieldLogger, cfg *config.Config, dispatcher pluginDispatcher) *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.

Jump to

Keyboard shortcuts

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