Commit b648b008 authored by ale's avatar ale

Move http_server config to main package

As it is for other id/ services.
parent 932b1017
Pipeline #810 passed with stages
in 1 minute and 32 seconds
......@@ -16,13 +16,18 @@ var (
configFile = flag.String("config", "/etc/user-meta-server.yml", "path of config file")
)
type Config struct {
server.Config `yaml:",inline"`
ServerConfig *serverutil.ServerConfig `yaml:"http_server"`
}
// Read the YAML configuration file.
func loadConfig() (*server.Config, error) {
func loadConfig() (*Config, error) {
data, err := ioutil.ReadFile(*configFile)
if err != nil {
return nil, err
}
var config server.Config
var config Config
if err := yaml.Unmarshal(data, &config); err != nil {
return nil, err
}
......@@ -38,7 +43,7 @@ func main() {
log.Fatal(err)
}
db, err := server.New(config)
db, err := server.New(&config.Config)
if err != nil {
log.Fatal(err)
}
......
......@@ -12,8 +12,7 @@ import (
// Config for the UserMetaServer.
type Config struct {
DBURI string `yaml:"db_uri"`
ServerConfig *serverutil.ServerConfig `yaml:"http_server"`
DBURI string `yaml:"db_uri"`
}
// UserMetaServer exposes the analysis service and the user metadata
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment