Skip to content

induzo/gohttpmw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Useful Go HTTP middlewares

Documentation Go Report Card Coverage Status CircleCI Maintainability

Content type

Simply set the content-type in the header.

RBAC

depends on

  • github.com/ory/ladon

Allows to check if a user is allowed to access the URL, according to his role. You need to specify the function that will get the role name from the context.

Request ID

depends on

  • github.com/rs/xid

Set a request id in the context as well as the header.

Security

Set the basic headers necessary for a better security. These are not sufficient, you will need to add more according to the context of your application.

Logger

If you want performance, use LoggerZero. Otherwise, simply use logrus. Add logs to the request If you use other middlewares, make sure they don't change the reference to the request