Documentation
¶
Index ¶
- Constants
- func AddRoutes(group *gin.RouterGroup, path, pluralPath string, controller any)
- func InitConf(path string, conf any) error
- func MetaRouteRegister(r *gin.Engine, strs ...string)
- func MetaRouteRegisterAll(r *gin.Engine)
- func NewGormMysql(conf *GormMysqlConf) (*gorm.DB, error)
- func NewLogger(writer io.Writer, logPath string, logLevel int) (*logger.Logger, error)
- func NewRedis(conf *RedisConf) *redis.Client
- type G
- func (g *G) ParsePathId(key string) (uint, error)
- func (g *G) ParseQueryDate(key string) *time.Time
- func (g *G) ParseQueryId(key string) uint
- func (g *G) ParseQueryIdList(key string) []uint
- func (g *G) ParseQueryPageArgs(maxSize uint64) (limit, offset uint)
- func (g *G) RenderData(data any)
- func (g *G) RenderDataOrError(data any, err error)
- func (g *G) RenderError(err error)
- func (g *G) RenderMessage(code int, message string)
- type GormMysqlConf
- type ICreateController
- type IDeleteController
- type IGetController
- type IListController
- type IUpdateController
- type RedisConf
- type RedisInstConf
- type Resp
- type RespError
Constants ¶
View Source
const ( RES_CODE_OK = iota RES_CODE_GENERAL_ERROR RES_CODE_INVALID_REQ RES_CODE_NOT_FOUND RES_CODE_ALREADY_EXIST RES_CODE_NOT_AUTHED RES_CODE_NOT_ALLOWED )
Variables ¶
This section is empty.
Functions ¶
func MetaRouteRegister ¶
func MetaRouteRegisterAll ¶
func NewGormMysql ¶
func NewGormMysql(conf *GormMysqlConf) (*gorm.DB, error)
Types ¶
type G ¶
func (*G) ParseQueryId ¶
func (*G) ParseQueryIdList ¶
func (*G) ParseQueryPageArgs ¶
func (*G) RenderData ¶
func (*G) RenderDataOrError ¶
func (*G) RenderError ¶
func (*G) RenderMessage ¶
type GormMysqlConf ¶
type ICreateController ¶
type ICreateController interface {
Create(*G)
}
type IDeleteController ¶
type IDeleteController interface {
Delete(*G)
}
type IGetController ¶
type IGetController interface {
Get(*G)
}
type IListController ¶
type IListController interface {
List(*G)
}
type IUpdateController ¶
type IUpdateController interface {
Update(*G)
}
type RedisConf ¶
type RedisConf struct { Red *RedisInstConf Db int }
type RedisInstConf ¶
Click to show internal directories.
Click to hide internal directories.