Documentation ¶
Index ¶
- Constants
- func Clear(c *gin.Context)
- func CreateUserAuthentication(c *gin.Context, form *userValidator.LoginForm) (*models.User, int, error)
- func CurrentUser(c *gin.Context) (*models.User, int, error)
- func Decode(cookieValue string) (uint, error)
- func Encode(userID uint, validUntil time.Time) (string, error)
- func RetrieveUserFromRequest(c *gin.Context, id uint) (*models.User, bool, uint, int, error)
- func SetLogin(c *gin.Context, user *models.User) (int, error)
- type CurrentUserRetriever
Constants ¶
View Source
const ( // CookieName : Name of cookie CookieName = "session" // UserContextKey : key for user context UserContextKey = "nyaapantsu.user" )
Variables ¶
This section is empty.
Functions ¶
func CreateUserAuthentication ¶
func CreateUserAuthentication(c *gin.Context, form *userValidator.LoginForm) (*models.User, int, error)
CreateUserAuthentication creates user authentication.
func CurrentUser ¶
CurrentUser retrieves a current user.
func RetrieveUserFromRequest ¶
RetrieveUser retrieves a user.
Types ¶
type CurrentUserRetriever ¶
type CurrentUserRetriever struct{}
CurrentUserRetriever struct for languages
func NewCurrentUserRetriever ¶
func NewCurrentUserRetriever() *CurrentUserRetriever
NewCurrentUserRetriever create CurrentUserRetriever Struct for languages
func (*CurrentUserRetriever) RetrieveCurrentUser ¶
RetrieveCurrentUser retrieve current user for languages
Click to show internal directories.
Click to hide internal directories.