common

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

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