routing

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key added in v0.5.0

type Key []byte

func NewKey added in v0.5.0

func NewKey(hostname string, path string) Key

NewKey creates a routing key from hostname (without port) and path.

func NewKeyFromRequest added in v0.5.0

func NewKeyFromRequest(req *http.Request) Key

NewKeyFromRequest creates a routing key from an HTTP request.

func NewKeyFromURL added in v0.5.0

func NewKeyFromURL(url *url.URL) Key

NewKeyFromURL creates a routing key from a URL.

func (Key) String added in v0.5.0

func (k Key) String() string

type Keys added in v0.5.0

type Keys []Key

type Table

type Table interface {
	util.HealthChecker

	HasSynced() bool
	Route(req *http.Request) *httpv1beta1.InterceptorRoute
	Signal()
	Start(ctx context.Context) error
}

func NewTable

func NewTable(reader client.Reader, counter queue.Counter) Table

type TableMemory added in v0.5.0

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

TableMemory is an immutable routing table.

func NewTableMemory added in v0.5.0

func NewTableMemory() *TableMemory

NewTableMemory creates an empty TableMemory.

func (*TableMemory) Remember added in v0.5.0

Remember adds an InterceptorRoute and returns a new TableMemory. Duplicates are not detected and existing entries are not updated.

func (*TableMemory) Route added in v0.5.0

func (tm *TableMemory) Route(hostname, path string, headers http.Header) *httpv1beta1.InterceptorRoute

Route finds an InterceptorRoute matching hostname, path and headers. Tries exact match first the hostname, then filter by headers and find the most specific match then it moves to wildcards with similar header matching rule, finally catch-all.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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