Documentation
¶
Index ¶
- func EncodePassword(password string, slat string) string
- func GenerateSlat() string
- func GenerateToken(payload TokenPayload) string
- func GetNowTime() time.Time
- func GetUniAuthAccessToken(code string) (string, error)
- func HttpGet(url string) ([]byte, error)
- func HttpGetJSON(url string, v interface{}) error
- func Md5(data string) string
- func ValidateJSON(obj interface{}, c *gin.Context) bool
- func ValidateQuery(obj interface{}, c *gin.Context) bool
- func ValidateUri(obj interface{}, c *gin.Context) bool
- type AccessTokenJSON
- type CustomClaims
- type Res
- func (r *Res) BadRequest(message string) *Res
- func (r *Res) Code(code int) *Res
- func (r *Res) Data(data interface{}) *Res
- func (r *Res) Error(message string) *Res
- func (r Res) Get(c *gin.Context)
- func (r *Res) Message(message string) *Res
- func (r *Res) NotFound(message string) *Res
- func (r *Res) ServerError(err error) *Res
- func (r *Res) Status(status int) *Res
- func (r *Res) Success(data interface{}) *Res
- func (r *Res) Unauthorized(message string) *Res
- type TokenPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePassword ¶
func GenerateSlat ¶
func GenerateSlat() string
func GenerateToken ¶
func GenerateToken(payload TokenPayload) string
func GetNowTime ¶
func GetUniAuthAccessToken ¶
func HttpGetJSON ¶
func ValidateJSON ¶
func ValidateQuery ¶
func ValidateUri ¶
Types ¶
type AccessTokenJSON ¶
type AccessTokenJSON struct {
AccessToken string `json:"accessToken"`
}
type CustomClaims ¶
type CustomClaims struct { jwt.StandardClaims TokenPayload }
func ParseToken ¶
func ParseToken(tokenString string) *CustomClaims
type Res ¶
type Res struct {
// contains filtered or unexported fields
}
func (*Res) BadRequest ¶
func (*Res) ServerError ¶
func (*Res) Unauthorized ¶
type TokenPayload ¶
Click to show internal directories.
Click to hide internal directories.