Documentation ¶
Index ¶
- Constants
- func GetConnector(cfg config.MySqlConfig, useDatabase bool, timeout uint32, multiStatements bool) (driver.Connector, error)
- func GetSession(cfg config.MySqlConfig) (*gorm.DB, error)
- func InitSession(cfg config.MySqlConfig, connector driver.Connector) (*gorm.DB, error)
- func ORGIDToDatabaseName(id int) string
- func ReplaceConfigDatabaseName(cfg config.MySqlConfig, orgID int) config.MySqlConfig
Constants ¶
View Source
const ( NON_DEFAULT_ORG_DATABASE_SUFFIX = "_deepflow" DATABASE_PREFIX_ALIGNMENT = "%04d" )
View Source
const ( DEFAULT_ORG_ID = 1 DEFAULT_TEAM_ID = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetConnector ¶
func GetSession ¶
func GetSession(cfg config.MySqlConfig) (*gorm.DB, error)
func InitSession ¶
func ORGIDToDatabaseName ¶
ORGIDToDatabaseName convert organization id to database name, format: 0002_deepflow
func ReplaceConfigDatabaseName ¶
func ReplaceConfigDatabaseName(cfg config.MySqlConfig, orgID int) config.MySqlConfig
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.