Documentation ¶
Index ¶
Constants ¶
View Source
const ( // UserKey the key used in the context for the user UserKey = "Auth.User" // RoleAdmin role given to admin users RoleAdmin = "Auth.RoleAdmin" // TokenSize token size in bytes TokenSize = 21 )
Variables ¶
View Source
var ( // ErrUserNotFound user not found in context ErrUserNotFound = errors.New("user not found in context") // ErrUserTypeMismatch failed to retrieve user, type mismatch ErrUserTypeMismatch = errors.New("failed to retrieve user, type mismatch") )
Functions ¶
func GenerateToken ¶
func LoadUserFromCtx ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.