http

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiServer

type MultiServer struct {
	HTTPPort  int
	HTTPSPort int
	CertFile  string
	KeyFile   string
	Logger    *log.Logger
}

MultiServer lets you create and run an HTTP server that serves over both, HTTP and HTTPS. It is a convenience wrapper around net/http and crypto/tls.

func (MultiServer) Start

func (srv MultiServer) Start(ctx context.Context, handler http.Handler) error

Start creates listeners for HTTP and HTTPS and starts serving requests using the provided handler. The function blocks until both servers are properly shut down. A shutdown can be initiated by cancelling the given context.

Jump to

Keyboard shortcuts

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