Begin refactor to better encapsulate configuration

This also updates the example_config.json which did not previously work.
Config.Config is now composed of embedded structs of other configs that
can later be used to clearly have a separation of concerns.
This commit is contained in:
Jimmy Zelinskie
2014-11-01 20:12:40 -04:00
parent d754b5b376
commit ddd10d9732
5 changed files with 69 additions and 84 deletions

View File

@@ -116,7 +116,7 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
tracker: tkr,
}
glog.V(0).Info("Starting on ", cfg.Addr)
glog.V(0).Info("Starting on ", cfg.ListenAddr)
if cfg.HttpListenLimit != 0 {
glog.V(0).Info("Limiting connections to ", cfg.HttpListenLimit)
}
@@ -126,7 +126,7 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
ConnState: srv.connState,
ListenLimit: cfg.HttpListenLimit,
Server: &http.Server{
Addr: cfg.Addr,
Addr: cfg.ListenAddr,
Handler: newRouter(srv),
ReadTimeout: cfg.HttpReadTimeout.Duration,
WriteTimeout: cfg.HttpWriteTimeout.Duration,