Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUserMiddleware ¶
func AddUserMiddleware(f func(*http.Request) User) mux.Middleware
Add a user to the request.
Types ¶
type User ¶
type User interface { // Check if the user is authenticated IsAuthenticated() bool // Check if the user is an administator IsAdmin() bool }
Default request user interface.
This interface can be used to check if the user is authenticated and if the user is an administrator.
If you want to use these middlewares, you should implement this interface.
Click to show internal directories.
Click to hide internal directories.