2017-04-27 05:58:34 +00:00
|
|
|
package config_manager
|
|
|
|
|
|
|
|
type Connection struct {
|
|
|
|
Ip string `json:"ip"`
|
|
|
|
Port string `json:"port"`
|
|
|
|
PortType string `json:"portType"`
|
2017-04-27 11:16:19 +00:00
|
|
|
SSL bool `json:"ssl"`
|
2017-04-27 05:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Target struct {
|
2017-04-27 11:19:40 +00:00
|
|
|
Auth map[string]interface{} `json:"auth"`
|
2017-04-27 11:16:19 +00:00
|
|
|
Connection Connection `json:"connection"`
|
2017-04-27 05:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Schedule struct {
|
|
|
|
Interval string `json:"interval"`
|
|
|
|
}
|
|
|
|
|
2017-04-27 11:16:19 +00:00
|
|
|
type Keys struct {
|
|
|
|
Metric string `json:"metric"`
|
2017-04-27 11:30:39 +00:00
|
|
|
Key string `json:"key"`
|
2017-04-27 11:16:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type QueryInfo struct {
|
|
|
|
Query string `json:"query"`
|
2017-04-27 11:19:40 +00:00
|
|
|
Extend map[string]interface{} `json:"extend"`
|
2017-04-27 11:16:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MappingInfo struct {
|
|
|
|
ParseDirection string `json:"parseDirection"`
|
|
|
|
ArrayColumns []string `json:"arrayColumns"`
|
|
|
|
KeyColumns []string `json:"keyColumns"`
|
|
|
|
ValueColumn string `json:"valueColumn"`
|
|
|
|
}
|
|
|
|
|
2017-04-27 05:58:34 +00:00
|
|
|
type Item struct {
|
2017-04-27 11:16:19 +00:00
|
|
|
Keys []Keys `json:"keys"`
|
|
|
|
QueryInfo QueryInfo `json:"queryInfo"`
|
|
|
|
MappingInfo MappingInfo `json:"mappingInfo"`
|
2017-04-27 05:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Crawler struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Container string `json:"container"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
Id string `json:"id"`
|
|
|
|
Target Target `json:"target"`
|
|
|
|
Schedule Schedule `json:"schedule"`
|
|
|
|
Crawler Crawler `json:"crawler"`
|
|
|
|
Items []Item `json:"items"`
|
|
|
|
}
|