server

package
v0.0.0-...-15a86da Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	chi.Router
}

func CreateRouter

func CreateRouter() Router

CreatCreateRouter creates router with custom configurations

func (Router) WithBasicMiddlewares

func (r Router) WithBasicMiddlewares() Router

WithBasicMiddlewares adds basic needed middlewares to the router

func (Router) WithCORS

func (r Router) WithCORS() Router

WithCORS adds CORS config to the router

func (Router) WithLoggingMiddleware

func (r Router) WithLoggingMiddleware() Router

WithLoggingMiddleware adds HTTP request logging

type Server

type Server struct {
	Logger *zap.SugaredLogger
	Router chi.Router
	Server *http.Server
}

func New

func New() (*Server, error)

New will setup Chi API listener

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(errChan chan error) error

ListenAndServe will listen for requests

Jump to

Keyboard shortcuts

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