Documentation ¶
Index ¶
- Constants
- func Authorization(ctx iris.Context) (claims *jwt.Claims, success bool)
- func FormatTime(t time.Time) (s string)
- func GetAuthorization(ctx iris.Context) (tokenStr string)
- func GetCtxToken(ctx iris.Context, token *jwt.Claims)
- func GetOrg(ctx iris.Context) int
- func RandCode(n int) string
- func RandTxt(n int) string
- func RandomString(n int) string
- func ResponseJSON(ctx iris.Context, j interface{})
- func SaveCtxToken(ctx iris.Context, token *jwt.Claims)
- func VerifyToken(tokenStr string) (claims *jwt.Claims, success bool)
Constants ¶
View Source
const ( AuthHeaderKey = "Authorization" AuthBearerKey = "Bearer " // I have a blank space AuthAccessKey = "accessToken" )
View Source
const ( CacheRsaBits = 1024 CacheSignInKey = "global:sign_in:key" )
View Source
const ( RespCodeSuccess = 200 RespCodeNotFound = 404 RespCodeNeedAuth = 401 RespCodeInternalError = 500 )
View Source
const ( RespMsgNotFount = "not found" RespMsgIdNum = "id must be a int value" )
View Source
const ( DefaultTimeFormatter = "2006-01-02:15:04:05" DateFormatter = "2006-01-02" DateFormatterNoSplit = "20060102" DefaultCodeLen = 16 )
View Source
const ( UserStatusActivate = 20 UserStatusDeActivate = 10 )
View Source
const (
ContentBlank = ""
)
Variables ¶
This section is empty.
Functions ¶
func Authorization ¶
func FormatTime ¶
func GetAuthorization ¶
func GetAuthorization(ctx iris.Context) (tokenStr string)
func GetCtxToken ¶
func RandomString ¶
func ResponseJSON ¶
func ResponseJSON(ctx iris.Context, j interface{})
func SaveCtxToken ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.