Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorResp(c *gin.Context, err error, code int, l ...bool)
- func ErrorStrResp(c *gin.Context, str string, code int, l ...bool)
- func GenerateToken(username string) (tokenString string, err error)
- func GetApiUrl(r *http.Request) string
- func Proxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.Obj) error
- func Sign(obj model.Obj, encrypt bool) string
- func SuccessResp(c *gin.Context, data ...interface{})
- type PageReq
- type PageResp
- type Resp
- type UserClaims
Constants ¶
View Source
const MaxInt = int(MaxUint >> 1)
View Source
const MaxUint = ^uint(0)
View Source
const MinInt = -MaxInt - 1
View Source
const MinUint = 0
Variables ¶
View Source
var HttpClient = &http.Client{}
View Source
var SecretKey []byte
Functions ¶
func GenerateToken ¶
func SuccessResp ¶
Types ¶
type PageReq ¶
type PageResp ¶
type PageResp struct { Content interface{} `json:"content"` Total int64 `json:"total"` }
type UserClaims ¶
type UserClaims struct { Username string `json:"username"` jwt.RegisteredClaims }
func ParseToken ¶
func ParseToken(tokenString string) (*UserClaims, error)
Click to show internal directories.
Click to hide internal directories.