From 34428cf465a1f5b4d842a094a84bedb28ca1bcc5 Mon Sep 17 00:00:00 2001 From: Leo Balduf <balduf@hm.edu> Date: Wed, 2 Mar 2016 22:15:48 +0100 Subject: [PATCH] config: fixed parsing of configs --- server/http/config.go | 5 +++-- server/store/store.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/http/config.go b/server/http/config.go index 83736ec..34108ef 100644 --- a/server/http/config.go +++ b/server/http/config.go @@ -7,6 +7,7 @@ package http import ( "time" + "github.com/chihaya/chihaya/config" "gopkg.in/yaml.v2" ) @@ -20,8 +21,8 @@ type httpConfig struct { RealIPHeader string `yaml:"real_ip_header"` } -func newHTTPConfig(srvcfg interface{}) (*httpConfig, error) { - bytes, err := yaml.Marshal(srvcfg) +func newHTTPConfig(srvcfg *config.ServerConfig) (*httpConfig, error) { + bytes, err := yaml.Marshal(srvcfg.Config) if err != nil { return nil, err } diff --git a/server/store/store.go b/server/store/store.go index 9eef204..d418875 100644 --- a/server/store/store.go +++ b/server/store/store.go @@ -70,8 +70,8 @@ type Config struct { IPStoreConfig interface{} `yaml:"ip_store_config"` } -func newConfig(srvcfg interface{}) (*Config, error) { - bytes, err := yaml.Marshal(srvcfg) +func newConfig(srvcfg *config.ServerConfig) (*Config, error) { + bytes, err := yaml.Marshal(srvcfg.Config) if err != nil { return nil, err }