preprocessor

package
v0.0.0-...-ec93226 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type      EventType
	Timestamp time.Time
	Key       RequestKey
	Object    runtime.Object
}

type EventMessage

type EventMessage struct {
	Ctx context.Context
	Err chan error

	Event
}

type EventPreprocessor

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

EventPreprocessor identifies the EventType for incoming events and routes them to the EventRouter. In case of List events, it buffers constituting list pages and provides the router with consolidated list events

func New

func New(logger logr.Logger, router EventRouter) *EventPreprocessor

New instantiates a new EventPreprocessor which passes the event to a router object

func (*EventPreprocessor) ReceiveEvent

func (processor *EventPreprocessor) ReceiveEvent(ctx context.Context,
	req *pb.EventRequest) (pb.ResponseType, error)

ReceiveEvent receives pb.EventRequest and passes it to watch/list handler

type EventReceiver

type EventReceiver interface {
	ReceiveEvent(ctx context.Context, req *pb.EventRequest) (pb.ResponseType, error)
}

type EventRouter

type EventRouter interface {
	RouteEvent(key RequestKey) chan *EventMessage
}

type EventType

type EventType string
const (
	List     EventType = "LIST"
	Added    EventType = "ADDED"
	Modified EventType = "MODIFIED"
	Deleted  EventType = "DELETED"
)

type RequestKey

type RequestKey struct {
	ClusterName string
	Group       string
	Version     string
	Kind        string
	Namespace   string
	NFDeploy    string
}

Jump to

Keyboard shortcuts

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