Documentation
¶
Index ¶
- type Router
- func (r *Router) AddBindings(b config.BotBindings) *Router
- func (r *Router) AddBindingsByIDIfConditionTrue(condition bool, c config.IdentifiableMap[config.ChannelBindingsByID]) *Router
- func (r *Router) AddBindingsByNameIfConditionTrue(condition bool, c config.IdentifiableMap[config.ChannelBindingsByName]) *Router
- func (r *Router) AddBindingsIfConditionTrue(condition bool, b config.BotBindings) *Router
- func (r *Router) AddCommunicationsBindings(c config.Communications)
- func (r *Router) AddElsIndexSinkBindingsIfConditionTrue(condition bool, b map[string]config.ELSIndex) *Router
- func (r *Router) AddEnabledActionBindings(c config.Actions)
- func (r *Router) AddSinkBindingsIfConditionTrue(condition bool, b config.SinkBindings) *Router
- func (r *Router) BuildTable(cfg *config.Config) *Router
- func (r *Router) GetBoundSources(sources map[string]config.Sources) map[string]config.Sources
- func (r *Router) HandleMappedEvent(ctx context.Context, targetEvent config.EventType, handlerFn eventHandler)
- func (r *Router) MapWithEventsInformer(srcEvent config.EventType, dstEvent config.EventType, ...) error
- func (r *Router) RegisterEventHandler(ctx context.Context, eventType config.EventType, handlerFn eventHandler)
- func (r *Router) RegisterInformers(targetEvents []config.EventType, handler registrationHandler) error
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 ¶
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 ¶
BuildTable builds the routers routing table marking it ready to register, map and handle informer events.
func (*Router) GetBoundSources ¶
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.