observer

package
v0.0.0-...-6ed4abe Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package observer NOTES

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	LocalCache func(kt *kit.Kit, es []*types.EventMeta)
}

Handler works to delete the related local resources.

type Interface

type Interface interface {
	// IsReady returns 'true' if the observer is already initialized,
	// which means the start cursor is loaded from db successfully.
	IsReady() bool

	// Next return a channel which is only used by caller, and it blocks
	// until a batch of events occurs.
	Next() <-chan []*types.EventMeta

	// CurrentCursor returns the latest consumed event's cursor id which is
	// consumed by the local cache.
	CurrentCursor() uint32

	// LoopInterval return the observer's loop duration to watch the events.
	LoopInterval() time.Duration
}

Interface defines all the observer support operations.

func New

func New(h *Handler, cs *clientset.ClientSet, name string) (Interface, error)

New create an observer instance.

Jump to

Keyboard shortcuts

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