package
1.101.9
Repository: https://github.com/vonage/gosrvlib.git
Documentation: pkg.go.dev

# Packages

Package route is deprecated.

# Functions

ApplyMiddleware returns an http Handler with all middleware handler functions applied.
GetPublicIPDefaultFunc returns the GetPublicIP function for a default ipify client.
LoggerMiddlewareFn returns the middleware handler function to handle logs.
New configures new HTTP server.
NopBinder returns a simple no-operation binder.
RequestInjectHandler wraps all incoming requests and injects a logger in the request scoped context.
Start configures and start a new HTTP server.
WithEnableAllDefaultRoutes enables all default routes on the server.
WithEnableDefaultRoutes sets the default routes to be enabled on the server.
WithIndexHandlerFunc replaces the index handler.
WithInstrumentHandler is deprecated.
WithIPHandlerFunc replaces the default ip handler function.
WithMethodNotAllowedHandlerFunc http handler called when a request cannot be routed.
WithMetricsHandlerFunc replaces the default metrics handler function.
WithMiddlewareFn adds one or more middleware handler functions to all routes (endpoints).
WithNotFoundHandlerFunc http handler called when no matching route is found.
WithoutDefaultRouteLogger disables the logger handler for the specified default routes.
WithoutRouteLogger disables the logger handler for all routes.
WithPanicHandlerFunc http handler to handle panics recovered from http handlers.
WithPingHandlerFunc replaces the default ping handler function.
WithPProfHandlerFunc replaces the default pprof handler function.
WithRedactFn set the function used to redact HTTP request and response dumps in the logs.
WithRequestTimeout sets a time limit for all routes after which a request receives a 503 Service Unavailable.
WithRouter replaces the default router used by the httpServer (mostly used for test purposes with a mock router).
WithServerAddr sets the address the httpServer will bind to.
WithServerReadHeaderTimeout sets the read header timeout.
WithServerReadTimeout sets the read timeout.
WithServerWriteTimeout sets the write timeout.
WithShutdownSignalChan sets the shared channel uset to signal a shutdown.
WithShutdownTimeout sets the shutdown timeout.
WithShutdownWaitGroup sets the shared waiting group to communicate externally when the server is shutdown.
WithStatusHandlerFunc replaces the default status handler function.
WithTLSCertData enable TLS with the given certificate and key data.
WithTraceIDHeaderName overrides the default trace id header name.

# Constants

IndexRoute is the identifier to enable the index handler.
IPRoute is the identifier to enable the ip handler.
MetricsRoute is the identifier to enable the metrics handler.
PingRoute is the identifier to enable the ping handler.
PprofRoute is the identifier to enable the pprof handler.
StatusRoute is the identifier to enable the status handler.

# Structs

HTTPServer defines the HTTP Server object.
Index contains the list of routes attached to the current service.
MiddlewareArgs contains extra optional arguments to be passed to the middleware handler function MiddlewareFn.
Route contains the HTTP route description.

# Interfaces

Binder is an interface to allow configuring the HTTP router.
Router is deprecated.

# Type aliases

DefaultRoute is the type for the default route names.
GetPublicIPFunc is a type alias for function to get public IP of the service.
IndexHandlerFunc is a type alias for the route index function.
InstrumentHandler is deprecated.
MiddlewareFn is a function that wraps an http.Handler.
Option is a type alias for a function that configures the HTTP httpServer instance.
RedactFn is an alias for a redact function.