Categorygithub.com/mwm-io/gapi
module
0.2.10
Repository: https://github.com/mwm-io/gapi.git
Documentation: pkg.go.dev

# README

Golang-API

Go Report Card PkgGoDev

This repository contains a set of small packages we use at MWM to build restfull APIs.

  • errors
  • log
  • middleware
  • server
  • stacktrace

Examples

You can see examples implementations in the examples folder:

# Packages

No description provided by the author
Package errors provides a generic error carrying useful information: - 2 different messages: one for the end user and one for the developer - a Kind: a string that can act as an ID for errors - a httpStatus - a timestamp of when the error was created This error implement the json.Marshaler and xml.Marshaler interface, so you can return this error in your http handlers.
No description provided by the author
Package log Gapi logging is based on zap.Logger and use its own global logger system to print logs.
Package middleware provides you multiple generic middlewares to use to enhance your http handlers.
Package openapi provides helper functions to use github.com/swaggest/openapi-go/openapi3 more easily.
No description provided by the author
Package server provides a simple router based https://github.com/gorilla/mux, with a SpecOpenAPIHandler type return the response (not serialized) and an error, as well as a Middleware type to allow middleware for this new SpecOpenAPIHandler type.
No description provided by the author