router

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(oo ...OptionFunc) (*http.ServeMux, error)

New creates an http router with functional options.

func NewFileServerRoute

func NewFileServerRoute(path string, assetsDir string, fallbackPath string) (*patronhttp.Route, error)

NewFileServerRoute returns a route that acts as a file server.

Types

type Config

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

Config definition.

type OptionFunc

type OptionFunc func(*Config) error

OptionFunc definition to allow functional configuration of the router.

func WithAliveCheck

func WithAliveCheck(acf patronhttp.LivenessCheckFunc) OptionFunc

WithAliveCheck option for the router.

func WithAppNameHeaders

func WithAppNameHeaders(name, version string) (OptionFunc, error)

WithAppNameHeaders option for adding name and version header to the response.

func WithDeflateLevel

func WithDeflateLevel(level int) OptionFunc

WithDeflateLevel option for the compression middleware.

func WithExpVarProfiling

func WithExpVarProfiling() OptionFunc

WithExpVarProfiling option for enabling expVar in profiling endpoints.

func WithMiddlewares

func WithMiddlewares(mm ...middleware.Func) OptionFunc

WithMiddlewares option for middlewares.

func WithReadyCheck

func WithReadyCheck(rcf patronhttp.ReadyCheckFunc) OptionFunc

WithReadyCheck option for the router.

func WithRoutes

func WithRoutes(routes ...*patronhttp.Route) OptionFunc

WithRoutes option for providing routes to the router.

Jump to

Keyboard shortcuts

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