Documentation
¶
Index ¶
- Variables
- func DBList()
- func Gorm() *gorm.DB
- func GormMssql() *gorm.DB
- func GormMssqlByConfig(m config.Mssql) *gorm.DB
- func GormMysql() *gorm.DB
- func GormMysqlByConfig(m config.Mysql) *gorm.DB
- func GormOracle() *gorm.DB
- func GormOracleByConfig(m config.Oracle) *gorm.DB
- func GormPgSql() *gorm.DB
- func GormPgSqlByConfig(p config.Pgsql) *gorm.DB
- func GormSqlite() *gorm.DB
- func GormSqliteByConfig(s config.Sqlite) *gorm.DB
- func InstallPlugin(PrivateGroup *gin.RouterGroup, PublicRouter *gin.RouterGroup, ...)
- func OtherInit()
- func PluginInit(group *gin.RouterGroup, Plugin ...plugin.Plugin)
- func PluginInitV2(group *gin.Engine, plugins ...plugin.Plugin)
- func Redis()
- func RedisList()
- func RegisterTables()
- func Reload() error
- func Routers() *gin.Engine
- func SetupHandlers()
- func Timer()
- type DBReadyNotifier
- type Index
- type PluginParams
Constants ¶
This section is empty.
Variables ¶
var Mongo = new(mongo)
Functions ¶
func GormMssqlByConfig ¶
GormMssqlByConfig 初始化Mysql数据库用过传入配置
func GormMysql ¶
GormMysql 初始化Mysql数据库 Author [piexlmax](https://github.com/piexlmax) Author [SliverHorn](https://github.com/SliverHorn) Author [ByteZhou-2018](https://github.com/ByteZhou-2018)
func GormMysqlByConfig ¶
GormMysqlByConfig 通过传入配置初始化Mysql数据库
func GormOracleByConfig ¶
GormOracleByConfig 初始化Oracle数据库用过传入配置
func GormPgSql ¶
GormPgSql 初始化 Postgresql 数据库 Author [piexlmax](https://github.com/piexlmax) Author [SliverHorn](https://github.com/SliverHorn)
func GormPgSqlByConfig ¶
GormPgSqlByConfig 初始化 Postgresql 数据库 通过指定参数
func GormSqliteByConfig ¶
GormSqliteByConfig 初始化Sqlite数据库用过传入配置
func InstallPlugin ¶
func InstallPlugin(PrivateGroup *gin.RouterGroup, PublicRouter *gin.RouterGroup, engine *gin.Engine)
func PluginInit ¶
func PluginInit(group *gin.RouterGroup, Plugin ...plugin.Plugin)
func RegisterTables ¶
func RegisterTables()
Types ¶
type DBReadyNotifier ¶
type DBReadyNotifier struct {
// contains filtered or unexported fields
}
DBReadyNotifier 数据库就绪通知器
func GetDBReadyNotifier ¶
func GetDBReadyNotifier() *DBReadyNotifier
GetDBReadyNotifier 获取全局通知器实例(单例)
func (*DBReadyNotifier) GetPluginParams ¶
func (n *DBReadyNotifier) GetPluginParams() *PluginParams
GetPluginParams 获取插件初始化参数
func (*DBReadyNotifier) NotifyDBReady ¶
func (n *DBReadyNotifier) NotifyDBReady()
NotifyDBReady 通知数据库已就绪 会触发所有订阅的回调函数
func (*DBReadyNotifier) SetPluginParams ¶
func (n *DBReadyNotifier) SetPluginParams(params *PluginParams)
SetPluginParams 设置插件初始化参数
func (*DBReadyNotifier) Subscribe ¶
func (n *DBReadyNotifier) Subscribe(callback func())
Subscribe 订阅数据库就绪事件 如果数据库已经就绪,立即执行回调 否则将回调加入订阅列表,等待通知
type PluginParams ¶
type PluginParams struct {
PrivateGroup *gin.RouterGroup
PublicRouter *gin.RouterGroup
Engine *gin.Engine
}
PluginParams 插件初始化参数