Documentation ¶
Index ¶
- func GenerateToken(User *core.User) (string, error)
- func GetJWTSecret() []byte
- func GetPage(c *gin.Context) int
- func GetPageInfo(c *gin.Context) (page, pageSize int)
- func GetPageOffset(c *gin.Context) (offset, limit int)
- func GetPageSize(c *gin.Context) int
- type Claims
- type Pager
- type Response
- type ValidError
- type ValidErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJWTSecret ¶
func GetJWTSecret() []byte
func GetPageInfo ¶ added in v0.2.0
func GetPageOffset ¶
func GetPageSize ¶
Types ¶
type Claims ¶
type Claims struct { UID int64 `json:"uid"` Username string `json:"username"` jwt.RegisteredClaims }
func ParseToken ¶
type Response ¶
func NewResponse ¶
func (*Response) ToErrorResponse ¶
func (*Response) ToResponse ¶
func (*Response) ToResponseList ¶
type ValidError ¶
type ValidError struct {
Message string
}
func (*ValidError) Error ¶
func (v *ValidError) Error() string
type ValidErrors ¶
type ValidErrors []*ValidError
func BindAndValid ¶
func BindAndValid(c *gin.Context, v any) (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.