arnaucube
arnaucube/tor-eth-online-shopPublic Self-hosted repository
tor-eth-online-shop/config.go
config.goRaw
 1package main
 2
 3import "github.com/spf13/viper"
 4
 5type Config struct {
 6	GethURL string
 7	PrivK   string
 8}
 9
10var config Config
11
12func ReadConfig(path, filename string) {
13	viper.SetConfigName(filename)
14	viper.AddConfigPath(path)
15	viper.SetConfigType("yaml")
16	if err := viper.ReadInConfig(); err != nil {
17		panic(err)
18	}
19	err := viper.Unmarshal(&config)
20	if err != nil {
21		panic(err)
22	}
23}