Versions in this module Expand all Collapse all v0 v0.1.2 Feb 19, 2021 v0.1.1 Feb 14, 2021 v0.1.0 Feb 13, 2021 Changes in this version + const CacheModeCache + const CacheModeRedis + const ERROR + const FAIL + const MiddlewareTypeBind + const MiddlewareTypeGlobal + const MiddlewareTypeGroup + const SUCCESS + const TypeConfig + const TypeDict + const UNAUTHORIZED + var AuthExcludePaths g.SliceStr + var AuthPaths g.SliceStr + var LoginPath string + var LogoutPath string + func CORS(r *ghttp.Request) + type GfToken struct + AuthExcludePaths g.SliceStr + AuthFailMsg string + AuthPaths g.SliceStr + AuthResponse func(r *ghttp.Request, respData Resp) + Authenticator func(r *ghttp.Request) bool + CacheKey string + CacheMode int8 + EncryptKey []byte + GlobalMiddleware bool + LoginPath string + LoginResponse func(r *ghttp.Request, respData Resp) + LoginValidate func(r *ghttp.Request) (string, interface{}) + LogoutPath string + LogoutResponse func(r *ghttp.Request, respData Resp) + LogoutValidate func(r *ghttp.Request) bool + MaxRefresh int + MiddlewareType uint + MultiLogin bool + ServerName string + Timeout int + TokenDelimiter string + func New() *GfToken + func (m *GfToken) AuthPath(urlPath string) bool + func (m *GfToken) DecryptToken(token string) Resp + func (m *GfToken) EncryptToken(userKey string, uuid string) Resp + func (m *GfToken) GetTokenData(r *ghttp.Request) Resp + func (m *GfToken) InitConfig() bool + func (m *GfToken) Intercept(group *ghttp.RouterGroup) bool + func (m *GfToken) Login(r *ghttp.Request) + func (m *GfToken) Logout(r *ghttp.Request) + func (m *GfToken) RemoveToken(token string) Resp + func (m *GfToken) Start() bool + func (m *GfToken) Stop() bool + func (m *GfToken) String() string + type Resp struct + Code int + Data interface{} + Msg string + func Error(msg string) Resp + func ErrorData(msg string, data interface{}) Resp + func Fail(msg string) Resp + func FailData(msg string, data interface{}) Resp + func Ok(data interface{}) Resp + func Unauthorized(msg string, data interface{}) Resp + func (resp Resp) DataInt() int + func (resp Resp) DataString() string + func (resp Resp) Get(key string) interface{} + func (resp Resp) GetInt(key string) int + func (resp Resp) GetString(key string) string + func (resp Resp) Json() string + func (resp Resp) Success() bool