Documentation ¶
Index ¶
- type HTTPListener
- type Metrics
- type Option
- func WithIdleTimeout(timeout time.Duration) Option
- func WithLogger(logger *zap.Logger) Option
- func WithMW(mw ...func(handler http.Handler) http.Handler) Option
- func WithMetrics(metrics Metrics) Option
- func WithReadTimeout(timeout time.Duration) Option
- func WithShutdownTimeout(timeout time.Duration) Option
- func WithWriteTimeout(timeout time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPListener ¶
type HTTPListener struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) *HTTPListener
type Option ¶
type Option func(*options)
func WithIdleTimeout ¶
WithIdleTimeout sets the maximum amount of time to wait for the next request.
func WithMW ¶
WithMW sets middleware. Order of middleware: third(second(first(handler))) The last one will be called first for any incoming request.
func WithMetrics ¶
WithMetrics enables metrics aggregation.
func WithReadTimeout ¶
WithReadTimeout sets the maximum duration for reading the entire request, including the body.
func WithShutdownTimeout ¶
WithShutdownTimeout sets the maximum duration for graceful shutdown (0 is no timeout).
func WithWriteTimeout ¶
WithWriteTimeout sets the maximum duration before timing out writes of the response.
Click to show internal directories.
Click to hide internal directories.