package
0.2.10
Repository: https://github.com/mwm-io/gapi.git
Documentation: pkg.go.dev

# Functions

AddDocHandlers will add the necessary handlers to serve a rapidoc endpoint: 2 endpoints to serve rapidoc.html and oauth-receiver.html from rapidoc and one endpoint to serve the json openapi definition of your API.
AddHandler register a new handler to the given mux router on a given method and path.
AddHandlerFactory register a new handler factory to the given mux router on a given method and path.
NewMux returns a new *mux.Router.
NewServer returns a new configured *http.Server, using an existing mux.Router.
ServeAndHandleShutdown start a *http.Server with the default configuration (overridden by the given Option) This function lock your program until a signal stopping your program is received.
ServeAndHandleTlSShutdown start a *http.Server with TLS and the default configuration (overridden by the given Option) This function lock your program until a signal stopping your program is received.
StartProcessAndHandleStopSignals starts the given process and listen for os stop signals to stop it, executing the shutdown function.
UseMiddlewares appends a given list of handler.Middleware to middlewares chain.
WithContext specify a parent context for the *http.Server.
WithCORS sets the cors configuration.
WithPort sets the server port on which to listen to.
WithStopSignals specify on which os.Signal we must shut down the server.
WithStopTimeout set the timeout when the shutting down the server.
WithStrictSlash specify if we use the strictSlash configuration or not.

# Structs

CORS contains the CORS configuration for the http server.

# Type aliases

Option is an option to modify the default configuration of the http server.