server

package
v0.0.0-...-6442850 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logging    bool
	CorsHeader string
	Version    string
	TLSConfig  *tls.Config
}

type HTTPSever

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

func (*HTTPSever) Serve

func (s *HTTPSever) Serve() error

type Server

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

func New

func New(cfg *Config) *Server

func (*Server) Accept

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

func (*Server) Close

func (s *Server) Close()

func (*Server) InitRouter

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

func (*Server) ServeAPI

func (s *Server) ServeAPI() error

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 configure.

func (*Server) Wait

func (s *Server) Wait(waitChain chan error)

Wait blocks the server goroutine util it exits. It sends an error message if there is anay error during The API execution.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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