common

package
v0.0.0-...-d4dbe2e Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	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 GenerateDSN

func GenerateDSN(cfg config.MySqlConfig, useDatabase bool, timeout uint32, multiStatements bool) string

func GetSession

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

func InitSession

func InitSession(dsn string) (*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