summaryrefslogtreecommitdiffstats
path: root/golang/cmd
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-09 20:26:39 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-09 20:26:39 -0700
commit9e6cfdf9668157ec7ff566c670ce293b18d2bc83 (patch)
tree52c00b694b5ea63705f7608aa02eaf7ba3ec51d4 /golang/cmd
parentc28602eba84c8c5ecfd267187ff103bb5e9d2091 (diff)
downloadfatcat-9e6cfdf9668157ec7ff566c670ce293b18d2bc83.tar.gz
fatcat-9e6cfdf9668157ec7ff566c670ce293b18d2bc83.zip
basic sentry; middleware; clacks-overhead
Diffstat (limited to 'golang/cmd')
-rw-r--r--golang/cmd/fatcatd/main.go17
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() {