package
1.7.0
Repository: https://github.com/acronis/go-appkit.git
Documentation: pkg.go.dev

# Packages

Package middleware contains set of middlewares for HTTP server.

# Functions

GetChiRoutePattern extracts chi route pattern from request.
New creates a new HTTPServer with predefined logging, metrics collecting, recovering after panics and health-checking functionality.
NewConfig creates a new instance of the Config.
NewConfigWithKeyPrefix creates a new instance of the Config.
NewHealthCheckHandler creates a new http.Handler for doing health-check.
NewHealthCheckHandlerContext creates a new http.Handler for doing health-check.
NewRouter creates a new chi.Router and performs its basic configuration.
NewWithHandler creates a new HTTPServer receiving already created http.Handler.

# Constants

Health-check statuses.
Health-check statuses.
StatusClientClosedRequest is a special HTTP status code used by Nginx to show that the client closed the request before the server could send a response.

# Structs

Config represents a set of configuration parameters for HTTPServer.
HealthCheckHandler implements http.Handler and does health-check of a service.
HTTPRequestMetricsOpts represents options for HTTPRequestMetricsOpts middleware that used in HTTPServer.
HTTPServer represents a wrapper around http.Server with additional fields and methods.
LimitsConfig represents a set of configuration parameters for HTTPServer relating to limits.
LogConfig represents a set of configuration parameters for HTTPServer relating to logging.
Opts represents options for creating HTTPServer.
RouterOpts represents options for creating chi.Router.
TimeoutsConfig represents a set of configuration parameters for HTTPServer relating to timeouts.
TLSConfig contains configuration parameters needed to initialize(or not) secure server.

# Type aliases

APIRoute is a type alias for single API route.
APIVersion is a type alias for API version.
HealthCheck is a type alias for health-check operation.
HealthCheckComponentName is a type alias for component names.
HealthCheckContext is a type alias for health-check operation that has access to the request Context.
HealthCheckResult is a type alias for result of health-check operation.
HealthCheckStatus is a resulting status of the health-check.