Documentation
¶
Overview ¶
Package middleware (logger) provides a simple middleware for the logger.Manager. Any provider can be used. The logged information is remoteAddr, HTTP Method, URL, Proto, HTTP Status, Response size and requested time. On HTTP status < 400 an info will be logged otherwise an error. The logger middleware should used before all other middlewares.
Package middleware (rbac) provides a role based access control list. It is build on top of the JWT middleware. A RoleService must be set, to check against the business logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRbacPatternService = "rbac: pattern or service is not defined" ErrRbacClaim = "rbac: claim is not set" )
Error messages.
Functions ¶
Types ¶
type RoleService ¶
type RoleService interface { // Allowed returns a boolean if the access is granted. // For the given url, HTTP method and jwt claim which includes specific user information. Allowed(pattern string, HTTPMethod string, claims interface{}) bool }
RoleService interface
Click to show internal directories.
Click to hide internal directories.