router

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine maps event names to registered routes and dispatches incoming events to the appropriate route handlers.

func New

func New(
	log logrus.FieldLogger,
	routes []route.Route,
	disabledEvents []xatu.Event_Name,
	metrics *telemetry.Metrics,
) *Engine

New creates a routing engine with the given routes.

func (*Engine) Route

func (r *Engine) Route(event *xatu.DecoratedEvent) Outcome

Route processes a single DecoratedEvent through the routing pipeline: extract metadata, find matching routes, and return routing decisions.

type Outcome

type Outcome struct {
	Results []Result
	Status  Status
}

Outcome holds routing decisions and the overall delivery status for one event. A non-delivered status means the event should not be written.

type Result

type Result struct {
	Table string
	Route route.Route
}

Result holds the routing decision for a single event: the target table name and the route that will handle flattening.

type Status

type Status uint8

Status represents the final processing outcome for one consumed Kafka message in the current attempt.

const (
	// StatusDelivered means processing completed successfully.
	StatusDelivered Status = iota
	// StatusErrored means processing failed transiently and should be
	// retried by replaying the message.
	StatusErrored
	// StatusRejected means processing failed permanently and the
	// message can be committed (dropped) without retry.
	StatusRejected
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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