serve

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReadTimeout       = 5 * time.Second
	DefaultWriteTimeout      = 10 * time.Second
	DefaultIdleTimeout       = 120 * time.Second
	DefaultReadHeaderTimeout = 5 * time.Second
	DefaultShutdownDelay     = 5 * time.Second
	DefaultDrainTimeout      = 10 * time.Second
)

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, srv *Server, logger *slog.Logger) error

func ListenAndServeTLS

func ListenAndServeTLS(ctx context.Context, srv *Server, logger *slog.Logger, certFile, keyFile string) error

Types

type Server

type Server struct {
	*http.Server
	ShutdownDelay time.Duration
	DrainTimeout  time.Duration
}

func WithDefaults

func WithDefaults(srv *http.Server) *Server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL