config

package
v0.0.0-...-1b09624 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(configFile string) error

Types

type GlobalConfig

type GlobalConfig struct {
	Env            string               `toml:"env"`
	Cluster        string               `toml:"cluster"`
	SyncIdFilePath string               `toml:"sync_id_file_path"`
	Http           HttpConfig           `toml:"http"`
	SSh            map[string]SShConfig `toml:"ssh"`
	Strategy       StrategyConfig       `toml:"strategy"`
	MysqlTask      []MysqlTaskConfig    `toml:"mysql_task"`
}
var Conf GlobalConfig

type HttpConfig

type HttpConfig struct {
	HttpPort    int64 `toml:"http_port"`
	MonitorPort int64 `toml:"monitor_port"`
}

type InspectConfig

type InspectConfig struct {
	InspectDuration   int64 `toml:"inspect_duration"`
	InspectAlarmCount int32 `toml:"inspect_alarm_count"`
}

type MqConfig

type MqConfig struct {
	Name     string   `toml:"name"`
	Kind     string   `toml:"kind"`
	ConfPath string   `toml:"conf_path"`
	Group    string   `toml:"group"`
	Topics   []string `toml:"topics"`
	LogPath  string   `toml:"log_path"`
	Cluster  string   `toml:"cluster"`
}

type MysqlMachineConfig

type MysqlMachineConfig struct {
	DbHost     string         `toml:"db_host"`
	DbPort     int            `toml:"db_port"`
	DbUsername string         `toml:"db_username"`
	DbPassword string         `toml:"db_password"`
	EnableSSh  bool           `toml:"enable_ssh"`
	MysqlSSh   MysqlSShConfig `toml:"ssh"`
}

type MysqlRegularConfig

type MysqlRegularConfig struct {
	TableName  string   `toml:"table_name"`
	FilterCols []string `toml:"filter_cols"`
	Upsert     bool     `toml:"upsert"`
}

type MysqlSShConfig

type MysqlSShConfig struct {
	SShUsername string `toml:"ssh_username"`
	TunnelHost  string `toml:"tunnel_host"`
	TunnelPort  int    `toml:"tunnel_port"`
}

type MysqlTaskConfig

type MysqlTaskConfig struct {
	TaskName      string                        `toml:"task_name"`
	DataBase      string                        `toml:"database"`
	DataMode      string                        `toml:"data_mode"`
	IncludeTables []string                      `toml:"include_tables"`
	ExcludeTables []string                      `toml:"exclude_tables"`
	Regular       map[string]MysqlRegularConfig `toml:"regular"`
	Source        MysqlMachineConfig            `toml:"source"`
	Target        MysqlMachineConfig            `toml:"target"`
	Strategy      TaskStrategyConfig            `toml:"strategy"`
}

type SShConfig

type SShConfig struct {
	UserName    string `toml:"username"`
	BoardHost   string `toml:"board_host"`
	Password    string `toml:"password"`
	PrivatePath string `toml:"private_path"`
}

type StrategyConfig

type StrategyConfig struct {
	SyncMq     SyncMqConfig     `toml:"sync_mq"`
	SyncDirect SyncDirectConfig `toml:"sync_direct"`
	Inspect    InspectConfig    `toml:"inspect"`
}

type SyncDirectConfig

type SyncDirectConfig struct {
	AppendDuration int64 `toml:"append_duration"`
}

type SyncMqConfig

type SyncMqConfig struct {
	Mysql []MqConfig `toml:"mysql"`
}

type TaskStrategyConfig

type TaskStrategyConfig struct {
	StrategyMode int16  `toml:"strategy_mode"`
	MqName       string `toml:"sync_mq_name"`
}

Jump to

Keyboard shortcuts

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