Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { App AppConfig `yaml:"app"` Replication struct { // ServerID is the unique ID of the replica in MySQL cluster. // Omit this option if you'd like to auto generate ID. ServerID *uint32 `yaml:"server_id"` // GTIDMode indicates when to use GTID-based replication // or binlog file position. GTIDMode bool `yaml:"gtid_mode"` // SourceOpts is the options of leader. SourceOpts SourceConfig `yaml:"source"` // UpstreamOpts is the options of follower. UpstreamOpts UpstreamConfig `yaml:"upstream"` // Rules contains rules to handle data during the replication. Rules []RuleConfig `yaml:"rules"` } `yaml:"replication"` }
func ReadFromFile ¶
type Logging ¶
type Logging struct { Level string `yaml:"level"` SysLogEnabled bool `yaml:"syslog_enabled"` FileLoggingEnabled bool `yaml:"file_enabled"` Filename string `yaml:"file_name"` MaxSize int `yaml:"file_max_size"` // megabytes MaxBackups int `yaml:"file_max_backups"` // files MaxAge int `yaml:"file_max_age"` // days }
type RuleConfig ¶
type SourceConfig ¶
type SourceConfig struct { Dump struct { // ExtraOptions for mysqldump CLI. ExtraOptions []string `yaml:"extra_options"` // ExecPath is absolute path to mysqldump binary. ExecPath string `yaml:"exec_path"` // LoadInFileFlushThreshold defines a maximum number of rows to collect before flushing to the upstream database. LoadInFileFlushThreshold int `yaml:"load_in_file_flush_threshold"` // LoadInFileEnabled set true whether you want to dump the data using the LOAD DATA INFILE statement // instead of sending the transactions one by one. LoadInFileEnabled bool `yaml:"load_in_file_enabled"` // SkipMasterData set true if you have no privilege to use `--master-data`. SkipMasterData bool `yaml:"skip_master_data"` } `yaml:"dump"` Addr string `yaml:"addr"` User string `yaml:"user"` Password string `yaml:"password"` Database string `yaml:"database"` Charset string `yaml:"charset"` }
type UpstreamConfig ¶
type UpstreamConfig struct { Addr string `yaml:"addr"` User string `yaml:"user"` Password string `yaml:"password"` Database string `yaml:"database"` Charset string `yaml:"charset"` MaxRetries int `yaml:"max_retries"` MaxOpenConns int `yaml:"max_open_conns"` MaxIdleConns int `yaml:"max_idle_conns"` ConnectTimeout time.Duration `yaml:"connect_timeout"` WriteTimeout time.Duration `yaml:"write_timeout"` }
Click to show internal directories.
Click to hide internal directories.