Documentation ¶
Index ¶
Constants ¶
View Source
const (
// StaticResources 静态资源路径, 相对 main.go 文件所在的
StaticResources = "../internal/app/static/"
)
Variables ¶
View Source
var ( // Settings 系统配置 Settings configs.ServerConfig // RouterGroup 路由规则 RouterGroup map[string][]*Route // MysqlDataBase 全局变量 MysqlDataBase *gorm.DB // RedisDataBase 全局变量 RedisDataBase *redis.Client )
全局变量
Functions ¶
func CreateToken ¶
CreateToken 创建一个token
func StartGinServ ¶
func StartGinServ(isDefault bool, middleware ...gin.HandlerFunc)
StartGinServ 启动 gin 服务
Types ¶
type CustomClaims ¶
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*CustomClaims, error)
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route 路由定义结构体
func NewFileRouter ¶
NewFileRouter 构造文件路由结构体
func (*Route) ExecHandler ¶
func (r *Route) ExecHandler() []gin.HandlerFunc
ExecHandler 执行模型中间件和 handlerFunc
type RouteHandle ¶
type RouteHandle struct {
// contains filtered or unexported fields
}
RouteHandle 路由执行结构体
func NewRouteHandle ¶
func NewRouteHandle(handlerFunc gin.HandlerFunc, moduleMiddlewares ...gin.HandlerFunc) *RouteHandle
Click to show internal directories.
Click to hide internal directories.