httpsrv

package
v0.0.0-...-0d3a668 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	Path    string
	Handler http.Handler
}

type Server

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

Server is the http server entity. It implements the http serving and multiplexing.

func NewServer

func NewServer() *Server

NewServer creates a new server.

func (*Server) RegisterRoute

func (s *Server) RegisterRoute(route Route) error

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes(routes []Route) error

func (*Server) Serve

func (s *Server) Serve(port int) error

Serve serves the http(s) server in the given port. It is a synchronous (blocking) call.

Jump to

Keyboard shortcuts

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