Documentation ¶
Index ¶
- Variables
- func GetHandlerName(fullname string) (string, error)
- func IsPublicPath(accessPath string) bool
- type LoginReq
- type LogoutReq
- type SetPwdReq
- type SimpleUserHandlers
- func (h *SimpleUserHandlers) Auth() gin.HandlerFunc
- func (h *SimpleUserHandlers) Init(userName, pwd string) (string, error)
- func (h *SimpleUserHandlers) IsAuthed(c *gin.Context)
- func (h *SimpleUserHandlers) IsInited() bool
- func (h *SimpleUserHandlers) Login(c *gin.Context)
- func (h *SimpleUserHandlers) Logout(c *gin.Context)
- func (h *SimpleUserHandlers) SetPwd(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUser = errors.New("invalid user name or password") ErrInvalidConfig = errors.New("invalid user config") UserParam = "user" PwdParam = "pwd" NewPwdParam = "newpwd" RoleParam = "role" ExpireParam = "expire" InitTimeParam = "initTime" TokenCookie = "tk" AdminRole = "admin" VisitorRole = "visitor" InitNs = "usersInit" UsersNs = "users" RolesNs = "roles" )
Functions ¶
func GetHandlerName ¶
func IsPublicPath ¶
Types ¶
type SimpleUserHandlers ¶
type SimpleUserHandlers struct {
// contains filtered or unexported fields
}
func NewSimpleUserHandlers ¶
func (*SimpleUserHandlers) Auth ¶
func (h *SimpleUserHandlers) Auth() gin.HandlerFunc
func (*SimpleUserHandlers) Init ¶
func (h *SimpleUserHandlers) Init(userName, pwd string) (string, error)
func (*SimpleUserHandlers) IsAuthed ¶
func (h *SimpleUserHandlers) IsAuthed(c *gin.Context)
func (*SimpleUserHandlers) IsInited ¶
func (h *SimpleUserHandlers) IsInited() bool
func (*SimpleUserHandlers) Login ¶
func (h *SimpleUserHandlers) Login(c *gin.Context)
func (*SimpleUserHandlers) Logout ¶
func (h *SimpleUserHandlers) Logout(c *gin.Context)
func (*SimpleUserHandlers) SetPwd ¶
func (h *SimpleUserHandlers) SetPwd(c *gin.Context)
Click to show internal directories.
Click to hide internal directories.