Documentation ¶
Index ¶
- Constants
- Variables
- func FileExist(path string) bool
- func GetContextValue[T any](ctx context.Context, key string) *T
- func GetGinTransaction()
- func GetVarP[T any](t T) *T
- func IntSliceToString(ints []int) string
- func MD5(str string) string
- func RandToken(num int) string
- type BaseClaims
- type CustomClaims
- type JWT
Constants ¶
View Source
const ( KB int64 = 1 << (10 * iota) MB GB TB )
View Source
const ( GinContextTransaction = "umc-gin-transaction" GinUseGlobalTransaction = "umc-gin-global-transaction" )
Variables ¶
Functions ¶
func GetGinTransaction ¶
func GetGinTransaction()
func IntSliceToString ¶
Types ¶
type CustomClaims ¶
type CustomClaims struct { BaseClaims BufferTime time.Time jwt.RegisteredClaims }
type JWT ¶
func (*JWT) CreateClaims ¶
func (j *JWT) CreateClaims(base BaseClaims) CustomClaims
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims *CustomClaims) (string, error)
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*CustomClaims, error)
func (*JWT) ReCreateToken ¶
func (j *JWT) ReCreateToken(old string, claims *CustomClaims) (string, error)
Click to show internal directories.
Click to hide internal directories.