Documentation
¶
Index ¶
- func GenSessionId(identity string) string
- func GenToken(identity string) string
- func GetSessionId(r *http.Request) (string, error)
- func GetToken(r *http.Request) (string, error)
- func NewConfig(secret string) *config
- type BaseUser
- type LoginManager
- func (manager *LoginManager) Auth(request *http.Request) (BaseUser, bool)
- func (manager *LoginManager) Current(request *http.Request) (BaseUser, bool)
- func (manager *LoginManager) GC()
- func (manager *LoginManager) Login(user BaseUser, w *http.ResponseWriter)
- func (manager *LoginManager) Logout(user BaseUser, r *http.Request, w *http.ResponseWriter)
- type UserMixin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenSessionId ¶
Types ¶
type LoginManager ¶
func NewLoginManager ¶
func NewLoginManager(config *config) *LoginManager
func (*LoginManager) Auth ¶
func (manager *LoginManager) Auth(request *http.Request) (BaseUser, bool)
func (*LoginManager) Current ¶
func (manager *LoginManager) Current(request *http.Request) (BaseUser, bool)
func (*LoginManager) GC ¶
func (manager *LoginManager) GC()
func (*LoginManager) Login ¶
func (manager *LoginManager) Login(user BaseUser, w *http.ResponseWriter)
func (*LoginManager) Logout ¶
func (manager *LoginManager) Logout(user BaseUser, r *http.Request, w *http.ResponseWriter)
Click to show internal directories.
Click to hide internal directories.