.
This commit is contained in:
37
config_manager/config.go
Normal file
37
config_manager/config.go
Normal 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"`
|
||||
}
|
||||
7
config_manager/config_manager.go
Normal file
7
config_manager/config_manager.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package config_manager
|
||||
|
||||
type ConfigManager interface {
|
||||
GetGlobalConfig() GlobalConfig
|
||||
GetCrawler(id string) Config
|
||||
}
|
||||
|
||||
18
config_manager/global_config.go
Normal file
18
config_manager/global_config.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user