Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MyAddr string `toml:"my_addr"` MyUser string `toml:"my_user"` MyPassword string `toml:"my_pass"` EsIndexs []string `toml:"es_indexs"` ESAddr string `toml:"es_addr"` StatAddr string `toml:"stat_addr"` ServerID uint32 `toml:"server_id"` Flavor string `toml:"flavor"` DataDir string `toml:"data_dir"` DumpExec string `toml:"mysqldump"` Sources []SourceConfig `toml:"source"` Rules []*Rule `toml:"rule"` }
func NewConfigWithFile ¶
type River ¶
type River struct {
// contains filtered or unexported fields
}
I change elastic to go elastic
type Rule ¶
type Rule struct { Schema string `toml:"schema"` Table string `toml:"table"` Index string `toml:"index"` Type string `toml:"type"` Parent string `toml:"parent"` // Default, a MySQL table field name is mapped to Elasticsearch field name. // Sometimes, you want to use different name, e.g, the MySQL file name is title, // but in Elasticsearch, you want to name it my_title. FieldMapping map[string]string `toml:"field"` // MySQL table information TableInfo *schema.Table //only MySQL fields in fileter will be synced , default sync all fields Fileter []string `toml:"filter"` }
If you want to sync MySQL data into elasticsearch, you must set a rule to let use know how to do it. The mapping rule may thi: schema + table <-> index + document type. schema and table is for MySQL, index and document type is for Elasticsearch.
func (*Rule) CheckFilter ¶
type SourceConfig ¶
Click to show internal directories.
Click to hide internal directories.