webserver

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, server *http.Server, opts ...Option) error

ListenAndServe runs the http.Server until the context is canceled or an error occurs.

func Serve

func Serve(ctx context.Context, server *http.Server, l net.Listener, opts ...Option) error

Serve runs the http.Server until the context is canceled or an error occurs.

Types

type Option

type Option func(*options) error

Option is a function that modifies the behavior of ListenAndServe and Serve.

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

WithShutdownTimeout sets the timeout for graceful shutdown.

Jump to

Keyboard shortcuts

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