Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMiddleware ¶
func DefaultMiddleware(path string, next http.HandlerFunc) http.HandlerFunc
DefaultMiddleware which handles Logging and Recover middleware
func RecoveryMiddleware ¶
func RecoveryMiddleware(next http.HandlerFunc) http.HandlerFunc
RecoveryMiddleware for recovering from failed requests
func TracingMiddleware ¶ added in v0.3.0
func TracingMiddleware(path string, next http.HandlerFunc) http.HandlerFunc
TracingMiddleware for handling tracing and metrics
Types ¶
type Component ¶ added in v0.2.0
type Component struct {
// contains filtered or unexported fields
}
Component implementation of HTTP.
type HealthCheckFunc ¶
type HealthCheckFunc func() HealthStatus
HealthCheckFunc defines a function for implementing a health check.
type HealthStatus ¶
type HealthStatus int
HealthStatus type represanting the health of a component.
const ( // Initializing represents a state before the component is Healthy. Initializing HealthStatus = 0 // Healthy represents a state defining a healthy state. Healthy HealthStatus = 1 // Unhealthy represents a state defining a unhealthy state. Unhealthy HealthStatus = 2 )
type Option ¶
Option defines a option for the HTTP service.
func HealthCheck ¶ added in v0.2.0
func HealthCheck(hcf HealthCheckFunc) Option
HealthCheck option for setting the health check function.
type Route ¶
type Route struct { Pattern string Method string Handler http.HandlerFunc Trace bool }
Route definition
func NewRouteRaw ¶ added in v0.2.0
func NewRouteRaw(p string, m string, h http.HandlerFunc) Route
NewRouteRaw returns a new route from a HTTP handler
Click to show internal directories.
Click to hide internal directories.