Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTimeouts = HTTPTimeouts{ ReadTimeout: 30 * time.Second, ReadHeaderTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second, IdleTimeout: 120 * time.Second, }
Functions ¶
Types ¶
type HTTPOption ¶
type HTTPOption func(srv *HTTPServer) error
func WithMaxHeaderBytes ¶
func WithMaxHeaderBytes(max int) HTTPOption
func WithTimeouts ¶
func WithTimeouts(timeouts HTTPTimeouts) HTTPOption
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func StartHTTPServer ¶
func StartHTTPServer(addr string, handler http.Handler, opts ...HTTPOption) (*HTTPServer, error)
func (*HTTPServer) Addr ¶
func (s *HTTPServer) Addr() net.Addr
func (*HTTPServer) Close ¶
func (s *HTTPServer) Close() error
func (*HTTPServer) Closed ¶
func (s *HTTPServer) Closed() bool
type HTTPTimeouts ¶
type WrappedResponseWriter ¶
type WrappedResponseWriter struct { StatusCode int ResponseLen int // contains filtered or unexported fields }
func NewWrappedResponseWriter ¶
func NewWrappedResponseWriter(w http.ResponseWriter) *WrappedResponseWriter
func (*WrappedResponseWriter) Header ¶
func (w *WrappedResponseWriter) Header() http.Header
func (*WrappedResponseWriter) Write ¶
func (w *WrappedResponseWriter) Write(bytes []byte) (int, error)
func (*WrappedResponseWriter) WriteHeader ¶
func (w *WrappedResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.