Documentation ¶
Index ¶
- Constants
- type Config
- type HTTPServer
- func (s *HTTPServer) Error(c *fiber.Ctx, status int, err error, context ...interface{}) error
- func (s HTTPServer) GetPager(c *fiber.Ctx) Pager
- func (s HTTPServer) HealthEndpoint() fiber.Handler
- func (s *HTTPServer) Init()
- func (s *HTTPServer) Run(ctx context.Context) error
- func (s *HTTPServer) Warn(c *fiber.Ctx, status int, err error, context ...interface{}) error
- type Pager
Constants ¶
View Source
const ( MaxLimit = 1000 DefaultLimit = 100 DefaultOffset = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct { Mux *fiber.App Log *zap.SugaredLogger Routes fiber.Router Config Config }
HTTPServer represents basic REST HTTP server abstarction
func NewServer ¶
func NewServer(config Config) HTTPServer
NewServer returns new HTTP server instance, initializes logger and metrics
func (*HTTPServer) Error ¶
func (s *HTTPServer) Error(c *fiber.Ctx, status int, err error, context ...interface{}) error
Error writes RFC-7807 json problem to response
func (HTTPServer) GetPager ¶
func (s HTTPServer) GetPager(c *fiber.Ctx) Pager
GetPager returns new configured Pager instance
func (HTTPServer) HealthEndpoint ¶
func (s HTTPServer) HealthEndpoint() fiber.Handler
HealthEndpoint for health checks
func (*HTTPServer) Init ¶
func (s *HTTPServer) Init()
Init initializes router and setting up basic routes for health and metrics
Click to show internal directories.
Click to hide internal directories.