http

package
v7.0.0-...-1c7ecba Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opts

type Opts struct {
	// Handler is the http.Handler to be used to serve http pages by the server.
	Handler http.Handler

	// BindAddress is the address the HTTP server should listen on.
	BindAddress string

	// SecureBindAddress is the address the HTTPS server should listen on.
	SecureBindAddress string

	// TLS is the TLS configuration for the server.
	TLS *options.TLS
}

Opts contains the information required to set up the server.

type Server

type Server interface {
	// Start blocks and runs the server.
	Start(ctx context.Context) error
}

Server represents an HTTP or HTTPS server.

func NewServer

func NewServer(opts Opts) (Server, error)

NewServer creates a new Server from the options given.

func NewServerGroup

func NewServerGroup(servers ...Server) Server

NewServerGroup creates a new Server to start and gracefully stop a collection of Servers.

Jump to

Keyboard shortcuts

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