Documentation
¶
Index ¶
- func New(oo ...OptionFunc) (*httprouter.Router, error)
- func NewFileServerRoute(path string, assetsDir string, fallbackPath string) (*v2.Route, error)
- type Config
- type OptionFunc
- func AliveCheck(acf v2.LivenessCheckFunc) OptionFunc
- func DeflateLevel(level int) OptionFunc
- func EnableAppNameHeaders(name, version string) OptionFunc
- func EnableExpVarProfiling() OptionFunc
- func Middlewares(mm ...middleware.Func) OptionFunc
- func ReadyCheck(rcf v2.ReadyCheckFunc) OptionFunc
- func Routes(routes ...*v2.Route) OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(oo ...OptionFunc) (*httprouter.Router, error)
New creates an http router with functional options.
Types ¶
type OptionFunc ¶
OptionFunc definition to allow functional configuration of the router.
func AliveCheck ¶
func AliveCheck(acf v2.LivenessCheckFunc) OptionFunc
AliveCheck option for the router.
func DeflateLevel ¶
func DeflateLevel(level int) OptionFunc
DeflateLevel option for the compression middleware.
func EnableAppNameHeaders ¶ added in v0.72.0
func EnableAppNameHeaders(name, version string) OptionFunc
EnableAppNameHeaders option for adding name and version header to the response.
func EnableExpVarProfiling ¶
func EnableExpVarProfiling() OptionFunc
EnableExpVarProfiling option for enabling expVar in profiling endpoints.
func Middlewares ¶
func Middlewares(mm ...middleware.Func) OptionFunc
Middlewares option for middlewares.
func ReadyCheck ¶
func ReadyCheck(rcf v2.ReadyCheckFunc) OptionFunc
ReadyCheck option for the router.
func Routes ¶
func Routes(routes ...*v2.Route) OptionFunc
Routes option for providing routes to the router.
Click to show internal directories.
Click to hide internal directories.