diff options
Diffstat (limited to 'golang/cmd/fatcatd')
-rw-r--r-- | golang/cmd/fatcatd/main.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/golang/cmd/fatcatd/main.go b/golang/cmd/fatcatd/main.go index e98e0f79..c0b9a2e5 100644 --- a/golang/cmd/fatcatd/main.go +++ b/golang/cmd/fatcatd/main.go @@ -8,6 +8,7 @@ import ( loads "github.com/go-openapi/loads" flags "github.com/jessevdk/go-flags" "github.com/spf13/viper" + "github.com/getsentry/raven-go" "git.archive.org/bnewbold/fatcat/golang/restapi" "git.archive.org/bnewbold/fatcat/golang/restapi/operations" @@ -15,21 +16,25 @@ import ( func init() { + viper.SetDefault("port", 9411) + viper.SetDefault("verbose", true) + viper.SetEnvPrefix("FATCAT") viper.AutomaticEnv() - viper.SetDefault("Port", 9411) - viper.SetDefault("Verbose", true) + viper.SetConfigType("toml") viper.SetConfigName("fatcatd.toml") viper.AddConfigPath(".") - err := viper.ReadInConfig() - if err != nil { - log.Fatalf("Fatal error config file: %s \n", err) - } + //err := viper.ReadInConfig() + //if err != nil { + // log.Fatalf("Error loading config: %s \n", err) + //} // not default of stderr log.SetOutput(os.Stdout); + raven.SetDSN(viper.GetString("sentry_dsn")); + } func main() { |