Allow mgo.ParseURL to set [/database] (#997)

* Allow mgo.ParseURL to set [/database]

As per Michael's solution we need to be able to set the database from
either the parsed connection string, or fallback to athens if not set.

Signed-off-by: Chris M <me@christophermills.co.uk>

* Remove TimeoutDuration which was removed #928

Signed-off-by: Chris M <me@christophermills.co.uk>

* Correct conf_test to accommodate for changes

I'd missed out the addition of DefaultDBName from the test, this has now
been corrected

Signed-off-by: Chris M <me@christophermills.co.uk>

* Make sure gofmt runs automatically on this machine

Y'know simple stuff.

Signed-off-by: Chris M <me@christophermills.co.uk>
This commit is contained in:
Chris Mills
2019-02-14 18:21:34 +00:00
committed by Aaron Schlesinger
parent aa3fb3389c
commit 2cf10c3ead
4 changed files with 23 additions and 12 deletions
+5 -1
View File
@@ -189,10 +189,14 @@ StatsExporter = "prometheus"
Region = ""
[Storage.Mongo]
# Full URL for mongo storage
# Full connection string for mongo storage
# Env override: ATHENS_MONGO_STORAGE_URL
URL = "mongodb://127.0.0.1:27017"
# Sets default database name for mongo storage if not set by URL
# Env override: ATHENS_MONGO_DEFAULT_DATABASE
DefaultDBName = "athens"
# Path to certificate to use for the mongo connection
# Env override: ATHENS_MONGO_CERT_PATH
CertPath = ""