config

package
v0.0.0-...-59d6468 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Main          *MainConfig
	MySQL         *MySqlConfig
	PositionSaver *PosAutoSaverConfig
	HealthChecker *HealthCheckerConfig
	AuditLog      *AuditLogHandlerConfig
	Kafka         *KafkaConfig
	ClickHouse    *ClickHouseConfig
)

Functions

func FindConfigPath

func FindConfigPath(configPath string) string

func InitConfig

func InitConfig(path string) error

Types

type AuditLogHandlerConfig

type AuditLogHandlerConfig struct {
	HandleTables []string `toml:"handle_tables"`
}

type ClickHouseConfig

type ClickHouseConfig struct {
	Addrs    []string `toml:"addrs"`
	User     string   `toml:"user"`
	Password string   `toml:"password"`
	DB       string   `toml:"db"`
	Debug    bool     `toml:"debug"`
}

type HealthCheckerConfig

type HealthCheckerConfig struct {
	CheckInterval     int `toml:"check_interval"`
	CheckPosThreshold int `toml:"check_pos_threshold"`
}

type KafkaConfig

type KafkaConfig struct {
	Addrs           []string `toml:"addrs"`
	BinlogTopic     string   `toml:"binlog_topic"`
	TxInfoTopic     string   `toml:"tx_info_topic"`
	OffsetStoreDir  string   `toml:"offset_store_dir"`
	Offset          *int64   `toml:"offsetStore"` // if it has no offset, set nil
	UseOldestOffset bool     `toml:"use_oldest_offset"`
}

type LogConfig

type LogConfig struct {
	LogFile  string `toml:"file"`
	LogLevel string `toml:"level"`
}

type MainConfig

type MainConfig struct {
	Log           *LogConfig             `toml:"log"`
	Mysql         *MySqlConfig           `toml:"mysql"`
	PositionSaver *PosAutoSaverConfig    `toml:"position_saver"`
	HealthChecker *HealthCheckerConfig   `toml:"health_checker"`
	AuditLog      *AuditLogHandlerConfig `toml:"audit_log"`
	Kafka         *KafkaConfig           `toml:"kafka"`
	ClickHouse    *ClickHouseConfig      `toml:"clickhouse"`
}

type MySqlConfig

type MySqlConfig struct {
	Driver            string   `toml:"driver"`
	Host              string   `toml:"host"`
	Port              int64    `toml:"port"`
	User              string   `toml:"user"`
	Password          string   `toml:"password"`
	Schemas           []string `toml:"schemas"`
	DbMaxIdle         int      `toml:"db_max_idle"`
	DbMaxOpen         int      `toml:"db_max_open"`
	DbConnMaxLifeTime int      `toml:"db_conn_max_life_time"`
}

type PosAutoSaverConfig

type PosAutoSaverConfig struct {
	SaveDir      string `toml:"save_dir"`
	SaveInterval int    `toml:"save_interval"`
}

Jump to

Keyboard shortcuts

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