http

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides options for configuring the creation of a http server.

func WithLogger

func WithLogger(l log.Logger) Option

WithLogger will add logging to the http server.

func WithTLS

func WithTLS(cfg *tls.Config) Option

WithTLS will configure the server to require TLS.

type Server

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

Server is an HTTP server to serve HTTP requests.

func New

func New(config server.Config, opts ...Option) (*Server, error)

New creates an HTTP server with a default handler and has not started to accept requests yet.

func (*Server) Handle

func (s *Server) Handle(mux http.Handler)

Handle associates the given handler with the server.

func (*Server) Serve

func (s *Server) Serve(result chan<- error)

Serve accepts incoming connections, creating a new service goroutine for each. The service goroutine reads requests and then call the handler to reply to them.

func (*Server) Stop

func (s *Server) Stop()

Stop shuts down the http server gracefully without interrupting an active connections.

Directories

Path Synopsis
Package mockhttp is a generated GoMock package.
Package mockhttp is a generated GoMock package.

Jump to

Keyboard shortcuts

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