http

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ListenAddress is where the server will be listening.
	// By default will listen on :8080.
	ListenAddress string
	// DrainTimeout is the draining timeout, by default is 2 seconds.
	DrainTimeout time.Duration
	// Handler is the handler that will serve the server.
	Handler http.Handler
	// Logger is the logger used by the server.
	Logger log.Logger
}

Config is the server configuration.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a Server that serves a handler.

func NewServer

func NewServer(cfg Config) (*Server, error)

NewServer returns a new HTTP server.

func (*Server) DrainAndShutdown

func (s *Server) DrainAndShutdown() error

DrainAndShutdown will drain the connections and shutdown the server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe runs the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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