server

package
v0.0.0-...-612eec2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

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

Mux manages handlers.

func NewMux

func NewMux(logger *zap.Logger) *Mux

NewMux creates new Mux http.Handler.

func (*Mux) Handle

func (m *Mux) Handle(pattern string, h http.Handler)

Handle registers the handler for the given pattern.

func (*Mux) ServeHTTP

func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP for represents http.Handler

type Server

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

Server represents an HTTP server.

func New

func New(h http.Handler) *Server

NewServer creates new Server.

func (*Server) Serve

func (s *Server) Serve(ln net.Listener) error

Serve starts accept requests from the given listener. If any returns error.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shutdown the server without interrupting any active connections. If any returns error.

Jump to

Keyboard shortcuts

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