This commit is contained in:
jackdaw@loafle.com
2017-04-27 14:58:34 +09:00
parent d4d98d14a2
commit d444ac72de
4 changed files with 80 additions and 1 deletions

37
config_manager/config.go Normal file
View File

@@ -0,0 +1,37 @@
package config_manager
type Auth struct {
}
type Connection struct {
Ip string `json:"ip"`
Port string `json:"port"`
PortType string `json:"portType"`
SSL bool `json:"ssl"`
}
type Target struct {
Auth Auth
Connection Connection
}
type Schedule struct {
Interval string `json:"interval"`
}
type Item struct {
}
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"`
}

View File

@@ -0,0 +1,7 @@
package config_manager
type ConfigManager interface {
GetGlobalConfig() GlobalConfig
GetCrawler(id string) Config
}

View File

@@ -0,0 +1,18 @@
package config_manager
/* global config 예제
central:
address: "http://localhost:9090"
port: 443
log_path: "./bin/log.xml"
*/
type GlobalConfig struct {
Central struct {
Address string
Port int
}
Log_Path string
}