Documentation
¶
Index ¶
- Variables
- func Fail(ctx *gin.Context, code int64, msg ...string)
- func FailWithMessage(ctx *gin.Context, msg string)
- func Gorm(name ...string) *gorm.DB
- func LoadConfig[T any](file string, env string, target *T) error
- func RegisterService(service ...IService)
- func Run()
- func SetDb(name string, gdb *gorm.DB, sdb *sqlx.DB)
- func Sqlx(name ...string) *sqlx.DB
- func Success(ctx *gin.Context, data interface{})
- func SuccessWithMessage(ctx *gin.Context, msg string)
- type BaseConfig
- type IServer
- type IService
- type PageResult
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Config *BaseConfig Log *iLog Cache *gzcache.CacheNode Casbin *casbinV2.SyncedEnforcer Rdb redis.Cmdable Mdb *mongo.Client )
Functions ¶
func FailWithMessage ¶
func RegisterService ¶
func RegisterService(service ...IService)
func SuccessWithMessage ¶
Types ¶
type BaseConfig ¶
type BaseConfig struct {
App app `mapstructure:"app"`
Db []databasesConf `mapstructure:"databases"`
Redis redisConf `mapstructure:"redis"`
Mongo mongoConf `mapstructure:"mongo"`
Logger logger `mapstructure:"logger"`
Casbin casbin `mapstructure:"casbin"`
Jwt jwt `mapstructure:"jwt"`
Oss oss `mapstructure:"oss"`
}
type PageResult ¶
Click to show internal directories.
Click to hide internal directories.