controller

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 53 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find added in v0.18.7

func Find(list []string, item string) bool

func NewController

func NewController(
	ctx context.Context,
	cmw configmap.Watcher,
) *controller.Impl

NewController initializes the controller and is called by the generated code. Registers event handlers to enqueue events.

Types

type ConsumerGroupHandler added in v0.18.7

type ConsumerGroupHandler func()

type ConsumerGroupWatcher added in v0.18.7

type ConsumerGroupWatcher interface {
	// Start instructs the watcher to start polling for the consumer groups and
	// notify any observers on the event of any changes
	Start() error

	// Terminate instructs the watcher to stop polling and clear the watchers cache
	Terminate()

	// Watch registers callback on the event of any changes observed
	// on the consumer groups. watcherID is an arbitrary string the user provides
	// that will be used to identify his callbacks when provided to Forget(watcherID).
	//
	// To ensure this is event-triggered, level-driven,
	// we don't pass the updates to the callback, instead the observer is expected
	// to use List() to get the updated list of ConsumerGroups.
	Watch(watcherID string, callback ConsumerGroupHandler) error

	// Forget removes all callbacks that correspond to the watcherID
	Forget(watcherID string)

	// List returns all the cached consumer groups that match matcher.
	// It will return an empty slice if none matched or the cache is empty
	List(matcher Matcher) []string
}

func NewConsumerGroupWatcher added in v0.18.7

func NewConsumerGroupWatcher(ctx context.Context, ac kafka.AdminClient, pollDuration time.Duration) ConsumerGroupWatcher

type Matcher added in v0.18.7

type Matcher func(string) bool

type Reconciler

type Reconciler struct {
	KubeClientSet kubernetes.Interface

	EventingClientSet eventingclientset.Interface
	// contains filtered or unexported fields
}

Reconciler reconciles Kafka Channels.

func (*Reconciler) FinalizeKind added in v0.14.0

func (r *Reconciler) FinalizeKind(ctx context.Context, kc *v1beta1.KafkaChannel) pkgreconciler.Event

func (*Reconciler) ReconcileKind added in v0.14.0

func (r *Reconciler) ReconcileKind(ctx context.Context, kc *v1beta1.KafkaChannel) pkgreconciler.Event

type WatcherImpl added in v0.18.7

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

func (*WatcherImpl) Forget added in v0.18.7

func (w *WatcherImpl) Forget(watcherID string)

func (*WatcherImpl) List added in v0.18.7

func (w *WatcherImpl) List(matcher Matcher) []string

func (*WatcherImpl) Start added in v0.18.7

func (w *WatcherImpl) Start() error

func (*WatcherImpl) Terminate added in v0.18.7

func (w *WatcherImpl) Terminate()

func (*WatcherImpl) Watch added in v0.18.7

func (w *WatcherImpl) Watch(watcherID string, cb ConsumerGroupHandler) error

TODO explore returning a channel instead of a taking callback

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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