HTTP server
The httpserver module provides an HTTP server built on the standard http.ServeMux, instrumented with OpenTelemetry.
go get github.com/go-oryn/oryn/httpserverQuick start
func main() { core.New( core.WithConfigFS(configs.FS), httpserver.Module, httpserver.AsHandler("GET /hello/{name}", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "hello %s", r.PathValue("name")) }), ).Run(httpserver.Serve())}httpserver.Moduleprovides the*http.Server, with the registered handlers and middlewares.httpserver.Serve()starts it with the application, and shuts it down gracefully when the application stops: in-flight requests are completed. If the server fails while running, the application stops.- Handlers, middlewares and handler groups are registered with
AsHandler,AsMiddlewareandAsHandlerGroup, see Routing. - Every request is traced, measured and logged, see Observability.
Configuration
The httpserver.* keys set the address, the timeouts, the request logs and the paths excluded from telemetry. See Configuration.
