-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.go
27 lines (23 loc) · 927 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main
import (
"github.com/kelseyhightower/envconfig"
"log"
)
type appConfig struct {
ElasticsearchHosts []string `split_words:"true"`
ElasticsearchIndexIncludePattern string `split_words:"true" default:"_all"`
FieldIgnorePrefix string `split_words:"true"`
EnableAggregations bool `split_words:"true" default:"true"`
EnableGraphiql bool `split_words:"true" default:"true"`
Port int `split_words:"true" default:"8080"`
Path string `split_words:"true" default:"/"`
EnableQueryLogging bool `split_words:"true" default:"true"`
EnableQueryResultLogging bool `split_words:"true" default:"true"`
}
var Config appConfig
func init() {
if err := envconfig.Process("sturgeon", &Config); err != nil {
log.Fatal(err)
}
log.Printf("%+v", Config)
}