Documentation ¶
Index ¶
- Variables
- func Debug(format string, values ...interface{})
- func LoadConfig(path string, resp interface{})
- func Loginfo(format string, values ...interface{})
- func LogrusMiddleware() gin.HandlerFunc
- func New(conf *CgoConfig) (g *gin.Engine)
- func NewConfig(path string)
- func NewLogrus() *logrus.Logger
- func NewMysql()
- func NewRedis() *redis.Client
- func NewTemplate(engine *gin.Engine, c *CgoConfig)
- func Pagination(page int, pageSize int, out interface{}, orderBy string, where string) error
- func Response404Err(ctx *gin.Context)
- func ResponseNoAuth(ctx *gin.Context)
- func ResponseParamErr(ctx *gin.Context)
- func ResponseSuccess(ctx *gin.Context, data interface{})
- func Run(gin *gin.Engine)
- func ServerErr(ctx *gin.Context, err string)
- func Unescaped(x string) interface{}
- func View(ctx *gin.Context, code int, tpl string, obj interface{})
- func View404(ctx *gin.Context, tpl string)
- type CgoConfig
- type JsonData
Constants ¶
This section is empty.
Variables ¶
View Source
var Config struct { App config.AppConfig Log config.LogConfig Db config.DbConfig Server config.ServerConfig Tpl config.TemplateConfig Jwt config.JwtConfig Redis config.RedisConfig Authorization config.AuthorizationConfig }
define Config struct
View Source
var Db *gorm.DB
View Source
var Logger *logrus.Logger
View Source
var Redis redisClient
Functions ¶
func LogrusMiddleware ¶
func LogrusMiddleware() gin.HandlerFunc
func Pagination ¶
查询分页数据
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.