config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	ListenAddr string  `yaml:"listen_addr"`
	DataFile   string  `yaml:"data_file"`
	Health     Health  `yaml:"health"`
	Logging    Logging `yaml:"logging"`
}

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"`
		// ConnectionSrc is the options to connect to MySQL.
		ConnectionSrc SourceConnectConfig `yaml:"mysql"`
		// ConnectionDest is the options to connect to Tarantool.
		ConnectionDest DestConnectConfig `yaml:"tarantool"`
		// Mappings contains rules to map data from MySQL to Tarantool.
		Mappings []Mapping `yaml:"mappings"`
	} `yaml:"replication"`
}

func ReadFromFile

func ReadFromFile(path string) (*Config, error)

type DestConnectConfig

type DestConnectConfig struct {
	Addr           string        `yaml:"addr"`
	User           string        `yaml:"user"`
	Password       string        `yaml:"password"`
	MaxRetries     int           `yaml:"max_retries"`
	ConnectTimeout time.Duration `yaml:"connect_timeout"`
	RequestTimeout time.Duration `yaml:"request_timeout"`
}

type Health added in v1.0.1

type Health struct {
	SecondsBehindMaster int `yaml:"seconds_behind_master"`
}

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 Mapping

type Mapping struct {
	Source struct {
		Schema  string   `yaml:"schema"`
		Table   string   `yaml:"table"`
		Columns []string `yaml:"columns"`
	} `yaml:"source"`

	Dest struct {
		Space  string                   `yaml:"space"`
		Column map[string]MappingColumn `yaml:"column"`
	} `yaml:"dest"`
}

type MappingColumn added in v1.0.5

type MappingColumn struct {
	Cast   string      `yaml:"cast"`
	OnNull interface{} `yaml:"on_null,omitempty"`
}

type SourceConnectConfig

type SourceConnectConfig struct {
	Dump struct {
		// ExecPath is absolute path to mysqldump binary.
		ExecPath string `yaml:"dump_exec_path"`
		// SkipMasterData set true if you have no privilege to use `--master-data`.
		SkipMasterData bool `yaml:"skip_master_data"`
		// ExtraOptions for mysqldump CLI.
		ExtraOptions []string `yaml:"extra_options"`
	} `yaml:"dump"`
	Addr     string `yaml:"addr"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Charset  string `yaml:"charset"`
}

Jump to

Keyboard shortcuts

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