server

package
v0.0.0-...-e91a8f2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(logger *echotozero.Logger) echo.MiddlewareFunc

MiddleWare logs successful requests to debug, failed req to error, and never skips.

func MiddlewareWithOptions

func MiddlewareWithOptions(logger *echotozero.Logger, successLvl, failLvl zerolog.Level, skipper middleware.Skipper) echo.MiddlewareFunc

func Paginate

func Paginate(c echo.Context, defaultLimit int) (*data.Paginate, error)

Types

type Config

type Config struct {
	util.DbConnectSettings

	LogJSON      bool
	LogVerbosity int

	HttpPort string

	BuildHash string
	BuildDate string
}

type Server

type Server struct {
	*echo.Echo

	*Config

	Db *data.DB
}

func Bootstrap

func Bootstrap(c *Config) (*Server, error)

Bootstrap calls various service allocators

func (*Server) GetUser

func (s *Server) GetUser(c echo.Context) error

func (*Server) GetUsers

func (s *Server) GetUsers(c echo.Context) error

func (*Server) Routes

func (s *Server) Routes()

func (*Server) Serve

func (s *Server) Serve()

func (*Server) SetUserAddress

func (s *Server) SetUserAddress(c echo.Context) error

func (*Server) TopRides

func (s *Server) TopRides(c echo.Context) error

func (*Server) Version

func (s *Server) Version(c echo.Context) error

Jump to

Keyboard shortcuts

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