server

package
v0.0.0-...-20679a4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandPort

func GetRandPort() uint16

GetRandPort generates a random port number from 1024 to 65535.

Types

type Server

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

Server is the http server implementation using 'echo' framework. It is central object for RESTful APIs in this app.

func New

func New(banner bool, logger *log.Logger) *Server

New creates a new instance of http server.

func (*Server) RegisterController

func (s *Server) RegisterController(ctrl controllers.Controller)

RegisterController adds the specified controller and its routes in the server runtime environment.

func (*Server) Run

func (s *Server) Run(port uint16) error

Run starts the http server and returns the error object for any failure.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown stops the http server gracefully and resets the server state.

Jump to

Keyboard shortcuts

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