Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
rename mongodb host option to URL (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
prydonius authored Nov 24, 2017
1 parent 391165c commit 8f20aca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ import (
var dbSession datastore.Session

func main() {
dbHost := flag.String("mongo-host", "localhost:27017", "MongoDB host")
dbURL := flag.String("mongo-url", "localhost", "MongoDB URL (see https://godoc.org/labix.org/v2/mgo#Dial for format)")
dbName := flag.String("mongo-database", "ratesvc", "MongoDB database")
flag.Parse()

mongoConfig := datastore.Config{Host: *dbHost, Database: *dbName}
mongoConfig := datastore.Config{URL: *dbURL, Database: *dbName}
var err error
dbSession, err = datastore.NewSession(mongoConfig)
if err != nil {
log.WithFields(log.Fields{"host": *dbHost}).Fatal(err)
log.WithFields(log.Fields{"host": *dbURL}).Fatal(err)
}

r := mux.NewRouter()
Expand Down

0 comments on commit 8f20aca

Please sign in to comment.