Documentation
¶
Index ¶
- func New(oo ...OptionFunc) (*http.ServeMux, error)
- func NewFileServerRoute(path string, assetsDir string, fallbackPath string) (*patronhttp.Route, error)
- type Config
- type OptionFunc
- func WithAliveCheck(acf patronhttp.LivenessCheckFunc) OptionFunc
- func WithAppNameHeaders(name, version string) (OptionFunc, error)
- func WithDeflateLevel(level int) OptionFunc
- func WithExpVarProfiling() OptionFunc
- func WithMiddlewares(mm ...middleware.Func) OptionFunc
- func WithReadyCheck(rcf patronhttp.ReadyCheckFunc) OptionFunc
- func WithRoutes(routes ...*patronhttp.Route) OptionFunc
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 OptionFunc ¶
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.
Click to show internal directories.
Click to hide internal directories.