Documentation
¶
Index ¶
- type Auth
- func (a *Auth) GenerateToken(id uint) (*AuthToken, error)
- func (a *Auth) GenerateTokenWithTime(id uint, t time.Time) (*AuthToken, error)
- func (a *Auth) GetContextUserID(ctx *gin.Context) uint
- func (a *Auth) GetUserID(ctx *gin.Context, strictCookie, refresh bool) (uint, error)
- func (a *Auth) SetContextUserID(ctx *gin.Context, id uint)
- func (a *Auth) SetCookieToken(ctx *gin.Context, token AuthToken, path string)
- type AuthToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth definition
func (*Auth) GenerateToken ¶
GenerateToken generates a new auth token with expired date computed with current time
func (*Auth) GenerateTokenWithTime ¶
GenerateTokenWithTime generates a new auth token with expired date computed with specified time
func (*Auth) GetContextUserID ¶
GetContextUserID returns auth user id from http context
func (*Auth) SetContextUserID ¶
SetContextUserID sets auth user id to http context
Click to show internal directories.
Click to hide internal directories.