muxes

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package muxes has implementations of the Mux interface to route tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegexTableMux

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

RegexTableMux provides a regex based router for table based on table names.

func NewRegexTableMux

func NewRegexTableMux() *RegexTableMux

NewRegexTableMux creates a new default RegexTableMux.

func (*RegexTableMux) AcceptTable

func (r *RegexTableMux) AcceptTable(ctx context.Context, metadata types.TableMetadata) (pxapi.TableRecordHandler, error)

AcceptTable implements the Muxer interface and is called when a new table is available.

func (*RegexTableMux) RegisterHandlerForPattern

func (r *RegexTableMux) RegisterHandlerForPattern(pattern string, handlerFunc TableRecordHandlerFunc) error

RegisterHandlerForPattern registers a handler function that is called based on the passed in regex pattern. The patterns are handled in the order specified.

type TableRecordHandlerFunc

type TableRecordHandlerFunc func(metadata types.TableMetadata) (pxapi.TableRecordHandler, error)

TableRecordHandlerFunc is called by the mux whenever a new table is streamed.

Jump to

Keyboard shortcuts

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