Documentation ¶
Index ¶
- Constants
- func GenerateToken(appKey, appSecret string) (string, error)
- func GetJWTSecret() []byte
- func GetPage(c *gin.Context) int
- func GetPageOffset(page, pageSize int) int
- func GetPageSize(c *gin.Context) int
- type Claims
- type Pager
- type Response
- type ResponseCommonStruct
- type TplResp
- type ValidError
- type ValidErrors
Constants ¶
View Source
const ( CODE_SUCCESS = 200 CODE_DOU_SUCCESS = 0 MSG_SUCCESS = "success" CODE_ROUTE_ERROR = 404 )
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func GetJWTSecret ¶
func GetJWTSecret() []byte
func GetPageOffset ¶
func GetPageSize ¶
Types ¶
type Claims ¶
type Claims struct { AppKey string `json:"app_key"` AppSecret string `json:"app_secret"` jwt.StandardClaims }
func ParseToken ¶
type Response ¶
func NewResponse ¶
func (*Response) ToErrorResponse ¶
func (*Response) ToResponse ¶
func (r *Response) ToResponse(data interface{})
func (*Response) ToResponseList ¶
type ResponseCommonStruct ¶
type ValidError ¶
func (*ValidError) Error ¶
func (v *ValidError) Error() string
type ValidErrors ¶
type ValidErrors []*ValidError
func BindAndValid ¶
func BindAndValid(c *gin.Context, v interface{}) (bool, ValidErrors)
func (ValidErrors) Error ¶
func (v ValidErrors) Error() string
func (ValidErrors) Errors ¶
func (v ValidErrors) Errors() []string
Click to show internal directories.
Click to hide internal directories.