channelwatcher

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListAllChannels

func ListAllChannels(ctx context.Context, c client.Client, shouldWatch ShouldWatchFunc) ([]v1alpha1.Channel, error)

ListAllChannels queries client and gets list of all channels for which shouldWatch returns true.

func New

func New(mgr manager.Manager, logger *zap.Logger, watchHandler WatchHandlerFunc) error

New creates a new instance of Channel Watcher that watches channels and calls the watchHandler on add, update, delete and generic event

Types

type ShouldWatchFunc

type ShouldWatchFunc func(ch *v1alpha1.Channel) bool

ShouldWatchFunc is called while returning list of channels. Channels are included in the list if the return value is true.

type WatchHandlerFunc

type WatchHandlerFunc func(context.Context, client.Client, types.NamespacedName) error

WatchHandlerFunc is called whenever an add, update, delete or generic event is triggered on a channel

func UpdateConfigWatchHandler

func UpdateConfigWatchHandler(updateConfig swappable.UpdateConfig, shouldWatch ShouldWatchFunc) WatchHandlerFunc

UpdateConfigWatchHandler is a special handler that 1. Lists the channels for which shouldWatch returns true. 2. Creates a multi-channel-fanout-config. 3. Calls the updateConfig func with the new multi-channel-fanout-config. This is used by dispatchers or receivers to update their configs by watching channels.

Jump to

Keyboard shortcuts

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