Documentation
¶
Index ¶
- func ListenAndServe(opts ...opt) error
- func Run(ctx context.Context, opts ...opt) error
- func WithAddress(host string, port uint16) opt
- func WithHandler(handler http.Handler) opt
- func WithIdleTimeout(d time.Duration) opt
- func WithMaxHeaderBytes(i int) opt
- func WithReadHeaderTimeout(d time.Duration) opt
- func WithReadTimeout(d time.Duration) opt
- func WithShutdownTimeout(d time.Duration) opt
- func WithTLSConfig(conf *tls.Config) opt
- func WithWriteTimeout(d time.Duration) opt
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func ListenAndServe(opts ...opt) error
ListenAndServe is a shortcut for New(opts...).ListenAndServe()
func WithAddress ¶
func WithHandler ¶
func WithIdleTimeout ¶
func WithMaxHeaderBytes ¶
func WithMaxHeaderBytes(i int) opt
func WithReadHeaderTimeout ¶
func WithReadTimeout ¶
func WithShutdownTimeout ¶
func WithTLSConfig ¶
func WithWriteTimeout ¶
Types ¶
type Server ¶
type Server interface {
// ListenAndServe is a wrapper for http.Server.ListenAndServe method, that
// returns nil when Server is closed. Otherwise, it always returns non-nil error
ListenAndServe() error
// Run runs http server and gracefully shuts it down on context cancellation. It
// works well in conjunction with custom os signals handling via context (signal.NotifyContext)
Run(ctx context.Context) error
}
Server is an interface for http server
Click to show internal directories.
Click to hide internal directories.