routing

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package routing contains the http.Handler routing logic.

Index

Constants

This section is empty.

Variables

Functions

func ConfigureRoute

func ConfigureRoute[R, C any](route R, config C, validateFn func(r R) error) (R, error)

ConfigureRoute configures a route using the provided configuration and validates it using the provided function.

func New

func New(invoker lambda.Facade, cfg *config.Server, decorators ...Decorator) (http.Handler, error)

New creates a new http.Handler for the aws.Facade using the Server.

Types

type Decorator

type Decorator func(decorated http.Handler, ref lambda.FnRef) http.Handler

Decorator for a http request.

func CurryMeteringFactory

func CurryMeteringFactory[O MeteringTarget[O], H http.Handler](fn MeterFactory[O, H], o O) Decorator

CurryMeteringFactory using the provided MeteringTarget and return a routing.Decorator from it.

type MeterFactory

type MeterFactory[O any, H http.Handler] func(O, http.Handler, ...promhttp.Option) H

MeterFactory for generic creation of MetricsDecorators handlers.

type MeteringTarget

type MeteringTarget[O any] interface {
	MustCurryWith(labels prometheus.Labels) O
}

MeteringTarget allowing to curry labels.

Jump to

Keyboard shortcuts

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