Documentation
¶
Index ¶
- Variables
- func NewService(secret string) *gins.Service
- type DB
- type Handlers
- type JWTAuth
- func (j *JWTAuth) Auth(c *gin.Context)
- func (j *JWTAuth) GenerateToken(user *User) (string, error)
- func (j *JWTAuth) GetToken(c *gin.Context) string
- func (j *JWTAuth) GetUser(c *gin.Context) *User
- func (j *JWTAuth) ParseToken(tokenString string) (*User, error)
- func (j *JWTAuth) SecurityScheme() []map[string][]string
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Admin = &User{
Id: 0,
Name: "admin",
Password: "admin",
}
View Source
var BearerSecurityScheme = "bearerAuth"
View Source
var SecuritySchemes = openapi.SecuritySchemes{ BearerSecurityScheme: &openapi.SecurityScheme{ Type: "apiKey", In: "header", Name: "Authorization", }, }
Functions ¶
func NewService ¶
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func NewHandlers ¶
type JWTAuth ¶
type JWTAuth struct {
// contains filtered or unexported fields
}
func NewJWTAuth ¶
func (*JWTAuth) SecurityScheme ¶
Click to show internal directories.
Click to hide internal directories.