Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option overrides behavior of Server.
func WithGracePeriod ¶
WithGracePeriod sets shutdown grace period for HTTP server. Server waits connections to drain for specified amount of time.
func WithListen ¶
WithListen sets address to listen for HTTP server. Server accepts incoming TCP connections on given address.
type ResponseWriterWithStatus ¶ added in v0.15.0
type ResponseWriterWithStatus struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriterWithStatus wraps around http.ResponseWriter to capture the status code of the response.
func WrapResponseWriterWithStatus ¶ added in v0.15.0
func WrapResponseWriterWithStatus(w http.ResponseWriter) *ResponseWriterWithStatus
WrapResponseWriterWithStatus wraps the http.ResponseWriter for extracting status.
func (*ResponseWriterWithStatus) Status ¶ added in v0.15.0
func (r *ResponseWriterWithStatus) Status() int
Status returns http response status.
func (*ResponseWriterWithStatus) WriteHeader ¶ added in v0.15.0
func (r *ResponseWriterWithStatus) WriteHeader(code int)
WriteHeader writes the header.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server defines parameters for serve HTTP requests, a wrapper around http.Server.
func New ¶
func New(logger log.Logger, reg *prometheus.Registry, comp component.Component, prober *prober.HTTPProbe, opts ...Option) *Server
New creates a new Server.
func (*Server) ListenAndServe ¶
ListenAndServe listens on the TCP network address and handles requests on incoming connections.