config

package
v1.6.66-0...-5b48dbd Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaDBTypeMySQL      = "MySQL"
	MetaDBTypePostgreSQL = "PostgreSQL"
	MetaDBTypeDM         = "DM"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type string

	Database     string
	Host         string
	Port         uint32
	ProxyHost    string
	ProxyPort    uint32
	UserName     string
	UserPassword string
	TimeOut      uint16

	DropDatabaseEnabled bool
	MaxOpenConns        uint16
	MaxIdleConns        uint16
	ConnMaxLifeTime     uint16
	BatchSize0          uint32
	BatchSize1          uint32

	// PostgreSQL
	Schema string

	// MySQL
	AutoIncrementIncrement uint32

	// DM
	DSN string
}

func (Config) GetAutoIncrementIncrement

func (c Config) GetAutoIncrementIncrement() uint32

func (*Config) InitFromDaMeng

func (c *Config) InitFromDaMeng(dmCfg DMConfig)

func (*Config) InitFromMySQL

func (c *Config) InitFromMySQL(mysqlCfg MySQLConfig)

func (*Config) InitFromPostgreSQL

func (c *Config) InitFromPostgreSQL(postgreSQLCfg PostgreSQLConfig)

type DMConfig

type DMConfig struct {
	Enabled   bool   `default:"false" yaml:"enabled"`
	Schema    string `default:"deepflow" yaml:"schema"`
	Host      string `default:"dameng" yaml:"host"`
	Port      uint32 `default:"5236" yaml:"port"`
	ProxyHost string `default:"" yaml:"proxy-host"`
	ProxyPort uint32 `default:"0" yaml:"proxy-port"`
	// commonConfig
	UserName     string `default:"root" yaml:"user-name"`
	UserPassword string `default:"deepflow" yaml:"user-password"`

	DSN                 string `default:"" yaml:"dsn"`
	TimeOut             uint16 `default:"30" yaml:"timeout"`
	DropDatabaseEnabled bool   `default:"false" yaml:"drop-database-enabled"`
	MaxOpenConns        uint16 `default:"100" yaml:"max_open_conns"`
	MaxIdleConns        uint16 `default:"50" yaml:"max_idle_conns"`
	ConnMaxLifeTime     uint16 `default:"60" yaml:"conn_max_life_time"`
	BatchSize0          uint32 `default:"100000" yaml:"batch-size-0"`
	BatchSize1          uint32 `default:"2500" yaml:"batch-size-1"`
}

func (DMConfig) FullfillConfig

func (c DMConfig) FullfillConfig(cfg *Config)

type MySQLConfig

type MySQLConfig struct {
	Enabled                bool   `default:"true" yaml:"enabled"`
	Database               string `default:"deepflow" yaml:"database"`
	Host                   string `default:"mysql" yaml:"host"`
	Port                   uint32 `default:"30130" yaml:"port"`
	ProxyHost              string `default:"" yaml:"proxy-host"`
	ProxyPort              uint32 `default:"0" yaml:"proxy-port"`
	AutoIncrementIncrement uint32 `default:"1" yaml:"auto_increment_increment"`
	// commonConfig
	UserName     string `default:"root" yaml:"user-name"`
	UserPassword string `default:"deepflow" yaml:"user-password"`

	TimeOut             uint16 `default:"30" yaml:"timeout"`
	DropDatabaseEnabled bool   `default:"false" yaml:"drop-database-enabled"`
	MaxOpenConns        uint16 `default:"100" yaml:"max_open_conns"`
	MaxIdleConns        uint16 `default:"50" yaml:"max_idle_conns"`
	ConnMaxLifeTime     uint16 `default:"60" yaml:"conn_max_life_time"`
	BatchSize0          uint32 `default:"100000" yaml:"batch-size-0"`
	BatchSize1          uint32 `default:"2500" yaml:"batch-size-1"`
}

func (MySQLConfig) FullfillConfig

func (c MySQLConfig) FullfillConfig(cfg *Config)

type PostgreSQLConfig

type PostgreSQLConfig struct {
	Enabled   bool   `default:"false" yaml:"enabled"`
	Database  string `default:"deepflow" yaml:"database"`
	Schema    string `default:"public" yaml:"schema"`
	Host      string `default:"postgresql" yaml:"host"`
	Port      uint32 `default:"5432" yaml:"port"`
	ProxyHost string `default:"" yaml:"proxy-host"`
	ProxyPort uint32 `default:"0" yaml:"proxy-port"`
	// commonConfig
	UserName     string `default:"root" yaml:"user-name"`
	UserPassword string `default:"deepflow" yaml:"user-password"`

	TimeOut             uint16 `default:"30" yaml:"timeout"`
	DropDatabaseEnabled bool   `default:"false" yaml:"drop-database-enabled"`
	MaxOpenConns        uint16 `default:"100" yaml:"max_open_conns"`
	MaxIdleConns        uint16 `default:"50" yaml:"max_idle_conns"`
	ConnMaxLifeTime     uint16 `default:"60" yaml:"conn_max_life_time"`
	BatchSize0          uint32 `default:"100000" yaml:"batch-size-0"`
	BatchSize1          uint32 `default:"2500" yaml:"batch-size-1"`
}

func (PostgreSQLConfig) FullfillConfig

func (c PostgreSQLConfig) FullfillConfig(cfg *Config)

type SessionConfig

type SessionConfig struct {
	DBCfg Config
	// set UseDabase=false in dsn only when migrating Metadb
	UseDabase bool
	// set TimeoutCoefficient=2 in dsn only when migrating Metadb
	TimeoutCoefficient uint16
	// set multiStatements=true in dsn only when migrating Metadb
	MultiStatements bool
}

Jump to

Keyboard shortcuts

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