Documentation ¶
Index ¶
Constants ¶
View Source
const ( LangDefault = "zh-CN" AcceptLang = "Accept-Language" )
View Source
const (
AlgorithmHS256 = "HS256"
)
Variables ¶
View Source
var ( StatusOK = 0 StatusError = 100 MsgOK = "OK" MsgFAIL = "FAIL" EmptyData = map[string]any{} )
View Source
var ( DefaultJWTConfig = JWTConfig{ SigningMethod: AlgorithmHS256, TokenLookup: "header:Authorization", AuthScheme: "Bearer", Claims: jwt.MapClaims{}, } )
Functions ¶
func HttpLanguage ¶
Types ¶
type I18n ¶
type JWTConfig ¶
type JWTConfig struct { SigningMethod string SigningKey any AuthScheme string TokenLookup string Expires time.Duration SigningKeys map[string]any Claims jwt.Claims KeyFunc jwt.Keyfunc ParseTokenFunc func(auth string) (*jwt.Token, error) }
func (*JWTConfig) DefaultKeyFunc ¶
func (*JWTConfig) DefaultParseToken ¶
Click to show internal directories.
Click to hide internal directories.