common

package
v1.6.65 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

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 GetConnector(cfg config.MySqlConfig, useDatabase bool, timeout uint32, multiStatements bool) (driver.Connector, error)

func GetSession

func GetSession(cfg config.MySqlConfig) (*gorm.DB, error)

func InitSession

func InitSession(cfg config.MySqlConfig, connector driver.Connector) (*gorm.DB, error)

func ORGIDToDatabaseName

func ORGIDToDatabaseName(id int) string

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.

Jump to

Keyboard shortcuts

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