Documentation ¶
Index ¶
- type HTTPServer
- func (s *HTTPServer) AddMiddleware(f MiddlewareFunc) *HTTPServer
- func (s *HTTPServer) AddRoute(f RouteFunc) *HTTPServer
- func (s *HTTPServer) ListenAndServe(addrs ...string) error
- func (s *HTTPServer) Shutdown(ctx context.Context)
- func (s *HTTPServer) WithReadTimeout(dur time.Duration)
- func (s *HTTPServer) WithWriteTimeout(dur time.Duration)
- type MiddlewareFunc
- type RouteFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer() *HTTPServer
func (*HTTPServer) AddMiddleware ¶
func (s *HTTPServer) AddMiddleware(f MiddlewareFunc) *HTTPServer
func (*HTTPServer) AddRoute ¶
func (s *HTTPServer) AddRoute(f RouteFunc) *HTTPServer
func (*HTTPServer) ListenAndServe ¶
func (s *HTTPServer) ListenAndServe(addrs ...string) error
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown(ctx context.Context)
gracefully shutdown the server, waiting max 30 seconds for current operations to complete ctx, _ := context.WithTimeout(context.Background(), 30*time.Second)
func (*HTTPServer) WithReadTimeout ¶
func (s *HTTPServer) WithReadTimeout(dur time.Duration)
func (*HTTPServer) WithWriteTimeout ¶
func (s *HTTPServer) WithWriteTimeout(dur time.Duration)
type MiddlewareFunc ¶
Click to show internal directories.
Click to hide internal directories.