Documentation ¶
Index ¶
- Constants
- func DefaultIsAuthenticated(c *gin.Context)
- func DefaultLoginFailed(c *gin.Context)
- func DefaultLoginSuccess(c *gin.Context)
- func DefaultLogout(c *gin.Context)
- func DefaultUnAuthenticate(c *gin.Context)
- func GetUniqueId(c *gin.Context) interface{}
- func GetUser(c *gin.Context) interface{}
- func IsAuthenticated(c *gin.Context) bool
- func IsLogin(c *gin.Context) bool
- func Logout(c *gin.Context) bool
- func NewCookieSession(engine *gin.Engine, conf AuthConf)
- func NewDefaultCookieSession(engine *gin.Engine, user User, MaxAge int, Secret string)
- func NewDefaultRedisSession(engine *gin.Engine, user User, MaxAge int, Secret string, ...)
- func NewRedisSession(engine *gin.Engine, conf AuthConf)
- func NewRememberMe(engine *gin.Engine, cookieKey string, maxAge int, secret string)
- func RequireUser() gin.HandlerFunc
- type AuthConf
- type AuthHandle
- type AuthRedis
- type AuthSession
- type LoginError
- type RememberMeConf
- type User
Constants ¶
View Source
const (
RMDefaultKey = "springCatRememberMe"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultIsAuthenticated ¶
func DefaultLoginFailed ¶
func DefaultLoginSuccess ¶
func DefaultLogout ¶
func DefaultUnAuthenticate ¶
func GetUniqueId ¶
func IsAuthenticated ¶
func NewCookieSession ¶
func NewDefaultCookieSession ¶
func NewDefaultRedisSession ¶
func NewRedisSession ¶
func NewRememberMe ¶
func RequireUser ¶
func RequireUser() gin.HandlerFunc
Types ¶
type AuthConf ¶
type AuthConf struct { Login AuthHandle Logout AuthHandle LoginSuccess AuthHandle LoginFailed AuthHandle UnAuthenticated AuthHandle IsAuthenticated AuthHandle Session AuthSession Redis AuthRedis LoginUser User }
type AuthHandle ¶
type AuthHandle struct {
// contains filtered or unexported fields
}
type AuthSession ¶
type LoginError ¶
type LoginError int
const ( ERROR_NO_USER LoginError = (iota + 1) ERROR_PASSWORD_WRONG ERROR_NO_USER_OR_NO_PASSWORD_WRONG ERROR_ALREADY_LOGIN ERROR_ALREADY_LOGOUT )
type RememberMeConf ¶
Click to show internal directories.
Click to hide internal directories.