Create fetch http server
This commit is contained in:
@@ -9,23 +9,27 @@ import (
|
||||
const cdbpath = "DBPath"
|
||||
const port = "port"
|
||||
const mport = "mport"
|
||||
const fport = "fport"
|
||||
|
||||
type Config struct {
|
||||
DBPath string
|
||||
Port string
|
||||
MonitorPort string
|
||||
FetchPort string
|
||||
}
|
||||
|
||||
func New() *Config {
|
||||
lookups := make(map[string]*string)
|
||||
add(cdbpath, "./db", lookups)
|
||||
add(port, "9101", lookups)
|
||||
add(mport, "9102", lookups)
|
||||
add(port, ":9101", lookups)
|
||||
add(mport, ":9102", lookups)
|
||||
add(fport, ":9103", lookups)
|
||||
flag.Parse()
|
||||
return &Config{
|
||||
DBPath: *lookups[cdbpath],
|
||||
Port: *lookups[port],
|
||||
MonitorPort: *lookups[mport],
|
||||
FetchPort: *lookups[fport],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user