Documentation
¶
Index ¶
Constants ¶
View Source
const ( SyncTypeMongo = "mongo" SyncTypeEs = "elasticsearch" SyncTypeMysql = "mysql" SyncTypeFile = "file" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Debug bool `toml:"debug" json:"debug,omitempty"` Mongo *MongoConfig `toml:"mongo" json:"mongo,omitempty"` Sync []*SyncConfig `toml:"sync" json:"sync,omitempty"` }
Config 配置文件
type MongoConfig ¶
type MongoConfig struct { SourceUri string `toml:"source_uri" json:"source_uri,omitempty"` SourceVersion float32 `toml:"source_version" json:"source_version,omitempty"` }
func (*MongoConfig) String ¶
func (c *MongoConfig) String() string
type SyncConfig ¶
type SyncConfig struct { Enable bool `toml:"enable" json:"enable,omitempty"` // 是否启用 Type string `toml:"type" json:"type,omitempty"` // mongo elasticsearch mysql file 一种输出类型只能配置一个,如果多个,请开启多个程序 DestinationUri string `toml:"destination_uri" json:"destination_uri,omitempty"` // 目标db链接地址 SourceDb string `toml:"source_db" json:"source_db,omitempty"` // 源db DestinationDb string `toml:"destination_db" json:"destination_db,omitempty"` // 目标db Collections map[string]string `toml:"collections" json:"collections,omitempty"` // 同步的集合对照 key:来源集合 val:目标集合或表等 CollectionField map[string][]string `toml:"collection_field" json:"collection_field,omitempty"` // 需要同步的字段列表 - 下标为来源db的collection名值为同步的字段列表 }
func (*SyncConfig) InCollectionField ¶
func (cfg *SyncConfig) InCollectionField(collection, field string) bool
func (*SyncConfig) String ¶
func (cfg *SyncConfig) String() string
Click to show internal directories.
Click to hide internal directories.