fixed make file and added an example database
This commit is contained in:
1 parent
32c9730321
commit
4ad71dd240
8 files changed
+62
-76
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"gopkg.in/mgo.v2"
|
||||
@@ -63,9 +64,10 @@ func (this *VultureBackend) GetDataBases() ([]string, error) {
|
||||
dbs, err := this.Client.DatabaseNames()
|
||||
if err == nil {
|
||||
return dbs, nil
|
||||
} else if err.Error() == "unauthorized" {
|
||||
} else if strings.Contains(err.Error(), "authorized") {
|
||||
return this.getDatabaseFromMongoURL()
|
||||
} else {
|
||||
fmt.Println(">>> ", err.Error())
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user