http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: LGPL-3.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 Server

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

Server a wrapped server that handle http request and respond to client.

func NewServer

func NewServer(_ context.Context, name, addr string) *Server

NewServer creates a new http server.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the listen address associate with the server.

func (*Server) GracefulShutdown

func (s *Server) GracefulShutdown(ctx context.Context)

GracefulShutdown stops the underlying HTTP server gracefully.

func (*Server) HTTPServer

func (s *Server) HTTPServer() *http.Server

HTTPServer returns the underlying HTTP server instance.

func (*Server) Router

func (s *Server) Router() *chi.Mux

Router get server's router to register handler.

func (*Server) Serve

func (s *Server) Serve() error

Serve handles all incoming connections, it blocks util Stop() function invoke explicitly.

func (*Server) Status

func (s *Server) Status() http.Handler

Status implementation of httprouter.Handle interface.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the underlying HTTP server forcibly.

Jump to

Keyboard shortcuts

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