initialize

package
v0.0.0-...-15e6e76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 47 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mongo = new(mongo)

Functions

func DBList

func DBList()

func Gorm

func Gorm() *gorm.DB

func GormMssql

func GormMssql() *gorm.DB

GormMssql 初始化Mssql数据库 Author [LouisZhang](191180776@qq.com)

func GormMssqlByConfig

func GormMssqlByConfig(m config.Mssql) *gorm.DB

GormMssqlByConfig 初始化Mysql数据库用过传入配置

func GormMysql

func GormMysql() *gorm.DB

GormMysql 初始化Mysql数据库 Author [piexlmax](https://github.com/piexlmax) Author [SliverHorn](https://github.com/SliverHorn) Author [ByteZhou-2018](https://github.com/ByteZhou-2018)

func GormMysqlByConfig

func GormMysqlByConfig(m config.Mysql) *gorm.DB

GormMysqlByConfig 通过传入配置初始化Mysql数据库

func GormOracle

func GormOracle() *gorm.DB

GormOracle 初始化oracle数据库

func GormOracleByConfig

func GormOracleByConfig(m config.Oracle) *gorm.DB

GormOracleByConfig 初始化Oracle数据库用过传入配置

func GormPgSql

func GormPgSql() *gorm.DB

GormPgSql 初始化 Postgresql 数据库 Author [piexlmax](https://github.com/piexlmax) Author [SliverHorn](https://github.com/SliverHorn)

func GormPgSqlByConfig

func GormPgSqlByConfig(p config.Pgsql) *gorm.DB

GormPgSqlByConfig 初始化 Postgresql 数据库 通过指定参数

func GormSqlite

func GormSqlite() *gorm.DB

GormSqlite 初始化Sqlite数据库

func GormSqliteByConfig

func GormSqliteByConfig(s config.Sqlite) *gorm.DB

GormSqliteByConfig 初始化Sqlite数据库用过传入配置

func InstallPlugin

func InstallPlugin(PrivateGroup *gin.RouterGroup, PublicRouter *gin.RouterGroup, engine *gin.Engine)

func OtherInit

func OtherInit()

func PluginInit

func PluginInit(group *gin.RouterGroup, Plugin ...plugin.Plugin)

func PluginInitV2

func PluginInitV2(group *gin.Engine, plugins ...plugin.Plugin)

func Redis

func Redis()

func RedisList

func RedisList()

func RegisterTables

func RegisterTables()

func Reload

func Reload() error

Reload 优雅地重新加载系统配置

func Routers

func Routers() *gin.Engine

func SetupHandlers

func SetupHandlers()

初始化全局函数

func Timer

func Timer()

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) IsDBReady

func (n *DBReadyNotifier) IsDBReady() bool

IsDBReady 检查数据库是否已就绪

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 Index

type Index struct {
	V    any      `bson:"v"`
	Ns   any      `bson:"ns"`
	Key  []bson.E `bson:"key"`
	Name string   `bson:"name"`
}

type PluginParams

type PluginParams struct {
	PrivateGroup *gin.RouterGroup
	PublicRouter *gin.RouterGroup
	Engine       *gin.Engine
}

PluginParams 插件初始化参数

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL