From 9be2c15e1cf116f45a0fc9cafa4128e8541b2df5 Mon Sep 17 00:00:00 2001 From: Mark Mulder Date: Sun, 11 Oct 2015 19:17:53 +0100 Subject: [PATCH] Add more documentation for Config and ESClient --- notifilter.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/notifilter.go b/notifilter.go index c315cd8..e9a889d 100644 --- a/notifilter.go +++ b/notifilter.go @@ -20,10 +20,12 @@ const maxPacketSize = 1024 * 1024 var db *sqlx.DB +// Config will be populated with settings loaded from the environment or +// local defaults type Config struct { AppPort int `default:"8000"` DBHost string `default:"127.0.0.1"` - DBUser string `default:"markmulder"` + DBUser string `default:""` DBPassword string `default:""` DBName string `default:"notifilter_development"` ESHost string `default:"127.0.0.1"` @@ -31,9 +33,10 @@ type Config struct { SlackHookURL string `required:"true"` } -// C holds main application config loaded from ENV variables +// C is a global variable that holds loaded config settings var C Config +// ESClient is a global variable that points to our ES client var ESClient elasticsearch.Client // Event will hold incoming data and will be persisted to ES eventually