modulepackage
2.0.0-beta.2+incompatible
Repository: https://github.com/euskadi31/go-server.git
Documentation: pkg.go.dev
# README
Go Server

Branch | Status | Coverage |
---|---|---|
master |
HTTP Server Router with middleware
Example
import "github.com/euskadi31/go-server"
router := server.NewRouter()
router.EnableMetrics()
router.EnableCors()
router.EnableHealthCheck()
router.AddHealthCheck("my-health-check", NewMyHealthCheck())
router.Use(MyMiddleWare())
router.AddController(MyController())
panic(http.ListenAndServe(":1337", router))
License
go-server is licensed under the MIT license.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
ConfigurationWithDefault return Configuration with default parameters.
New Server.
NewRouter constructor.
# Variables
DefaultCipherSuites defines the recommended cipher suites for modern TLS.
DefaultCurvePreferences defines the recommended elliptic curves for modern TLS.
DefaultIdleTimeout sets the maximum amount of time a Keep-Alive connection can remain idle before being recycled (120s).
DefaultMinVersion defines the recommended minimum version to use for the TLS protocol (1.2).
DefaultReadTimeout sets the maximum time a client has to fully stream a request (5s).
DefaultShutdownTimeout sets the maximum amount of time a shutdown.
DefaultWriteTimeout sets the maximum amount of time a handler has to fully process a request (10s).
# Structs
Configuration struct.
HealthCheckResponse struct.
HTTPConfiguration struct.
HTTPSConfiguration struct.
MockHealthCheckHandler is an autogenerated mock type for the HealthCheckHandler type.
Router struct.
Server struct.
# Interfaces
Controller interface.
HealthCheckHandler typego:generate mockery -case=underscore -inpkg -name=HealthCheckHandler.
# Type aliases
HealthCheckHandlerFunc handler.