server

package
v24.0.0-beta.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

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

HTTPServer contains an instance of http server and the listener. srv *http.Server, contains configuration to create an http server and a mux router with all api end points. l net.Listener, is a TCP or Socket listener that dispatches incoming request to the router.

func (*HTTPServer) Close

func (s *HTTPServer) Close() error

Close closes the HTTPServer from listening for the inbound requests.

func (*HTTPServer) Serve

func (s *HTTPServer) Serve() error

Serve starts listening for inbound requests.

type Server

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

Server contains instance details for the server

func (*Server) Accept

func (s *Server) Accept(addr string, listeners ...net.Listener)

Accept sets a listener the server accepts connections into.

func (*Server) Close

func (s *Server) Close()

Close closes servers and thus stop receiving requests

func (*Server) InitRouter

func (s *Server) InitRouter(routers ...router.Router)

InitRouter initializes the list of routers for the server. This method also enables the Go profiler.

func (*Server) Serve

func (s *Server) Serve() error

Serve starts listening for inbound requests.

func (*Server) UseMiddleware

func (s *Server) UseMiddleware(m middleware.Middleware)

UseMiddleware appends a new middleware to the request chain. This needs to be called before the API routes are configured.

Jump to

Keyboard shortcuts

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