config: fixed parsing of configs
This commit is contained in:
parent
919f97e4bf
commit
34428cf465
2 changed files with 5 additions and 4 deletions
|
@ -7,6 +7,7 @@ package http
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/chihaya/chihaya/config"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,8 +21,8 @@ type httpConfig struct {
|
||||||
RealIPHeader string `yaml:"real_ip_header"`
|
RealIPHeader string `yaml:"real_ip_header"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func newHTTPConfig(srvcfg interface{}) (*httpConfig, error) {
|
func newHTTPConfig(srvcfg *config.ServerConfig) (*httpConfig, error) {
|
||||||
bytes, err := yaml.Marshal(srvcfg)
|
bytes, err := yaml.Marshal(srvcfg.Config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ type Config struct {
|
||||||
IPStoreConfig interface{} `yaml:"ip_store_config"`
|
IPStoreConfig interface{} `yaml:"ip_store_config"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func newConfig(srvcfg interface{}) (*Config, error) {
|
func newConfig(srvcfg *config.ServerConfig) (*Config, error) {
|
||||||
bytes, err := yaml.Marshal(srvcfg)
|
bytes, err := yaml.Marshal(srvcfg.Config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue