source

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

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

Router routes handled event types from registered informers to configured sources

func NewRouter

func NewRouter(mapper meta.RESTMapper, dynamicCli dynamic.Interface, log logrus.FieldLogger) *Router

NewRouter creates a new router to use for routing event types to registered informers.

func (*Router) AddBindings

func (r *Router) AddBindings(b config.BotBindings) *Router

AddBindings adds source binding names to dictate which source bindings the router should use.

func (*Router) AddBindingsByIDIfConditionTrue

func (r *Router) AddBindingsByIDIfConditionTrue(condition bool, c config.IdentifiableMap[config.ChannelBindingsByID]) *Router

AddBindingsByIDIfConditionTrue adds source binding names to dictate which source bindings the router should use.

func (*Router) AddBindingsByNameIfConditionTrue

func (r *Router) AddBindingsByNameIfConditionTrue(condition bool, c config.IdentifiableMap[config.ChannelBindingsByName]) *Router

AddBindingsByNameIfConditionTrue adds source binding names to dictate which source bindings the router should use.

func (*Router) AddBindingsIfConditionTrue

func (r *Router) AddBindingsIfConditionTrue(condition bool, b config.BotBindings) *Router

AddBindingsIfConditionTrue adds source binding names to dictate which source bindings the router should use.

func (*Router) AddCommunicationsBindings

func (r *Router) AddCommunicationsBindings(c config.Communications)

AddCommunicationsBindings adds source binding from a given communications

func (*Router) AddElsIndexSinkBindingsIfConditionTrue

func (r *Router) AddElsIndexSinkBindingsIfConditionTrue(condition bool, b map[string]config.ELSIndex) *Router

AddElsIndexSinkBindingsIfConditionTrue adds source bindings names to dictate which source bindings the router should use.

func (*Router) AddEnabledActionBindings

func (r *Router) AddEnabledActionBindings(c config.Actions)

AddEnabledActionBindings adds source bindings for enabled Actions.

func (*Router) AddSinkBindingsIfConditionTrue

func (r *Router) AddSinkBindingsIfConditionTrue(condition bool, b config.SinkBindings) *Router

AddSinkBindingsIfConditionTrue adds source bindings names to dictate which source bindings the router should use.

func (*Router) BuildTable

func (r *Router) BuildTable(cfg *config.Config) *Router

BuildTable builds the routers routing table marking it ready to register, map and handle informer events.

func (*Router) GetBoundSources

func (r *Router) GetBoundSources(sources map[string]config.Sources) map[string]config.Sources

GetBoundSources returns the Sources the router uses based on preconfigured source binding names.

func (*Router) HandleMappedEvent

func (r *Router) HandleMappedEvent(ctx context.Context, targetEvent config.EventType, handlerFn eventHandler)

HandleMappedEvent allows router clients to create handlers that are triggered for a target mapped event.

func (*Router) MapWithEventsInformer

func (r *Router) MapWithEventsInformer(srcEvent config.EventType, dstEvent config.EventType, handler registrationHandler) error

MapWithEventsInformer allows resources to report on an event (srcEvent) that can only be observed by watching the general k8s v1/events resource using a different event (dstEvent).

For example, you can report the "error" EventType for a resource by having the router watch/interrogate the "warning" EventType reported by the v1/events resource.

func (*Router) RegisterEventHandler

func (r *Router) RegisterEventHandler(ctx context.Context, eventType config.EventType, handlerFn eventHandler)

RegisterEventHandler allows router clients to create handlers that are triggered for a target event.

func (*Router) RegisterInformers

func (r *Router) RegisterInformers(targetEvents []config.EventType, handler registrationHandler) error

RegisterInformers register informers for all the resources that match the target events.

Jump to

Keyboard shortcuts

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