From f2ac0d970c0987c4ba70a111a5f52a493f712c91 Mon Sep 17 00:00:00 2001
From: Niall Sheridan <nsheridan@gmail.com>
Date: Sat, 21 May 2016 21:35:41 +0100
Subject: [PATCH] Remove database config. Not needed.

---
 server/config/config.go      | 16 +++-------------
 server/config/config_test.go | 15 ---------------
 testdata/config.go           | 10 ----------
 3 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/server/config/config.go b/server/config/config.go
index bf5bfc7d..7598f0a9 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -8,10 +8,9 @@ import (
 
 // Config holds the values from the json config file.
 type Config struct {
-	Server   Server   `mapstructure:"server"`
-	Auth     Auth     `mapstructure:"auth"`
-	SSH      SSH      `mapstructure:"ssh"`
-	Database Database `mapstructure:"database"`
+	Server Server `mapstructure:"server"`
+	Auth   Auth   `mapstructure:"auth"`
+	SSH    SSH    `mapstructure:"ssh"`
 }
 
 // Server holds the configuration specific to the web server and sessions.
@@ -23,15 +22,6 @@ type Server struct {
 	CookieSecret string `mapstructure:"cookie_secret"`
 }
 
-// Database holds the configuration specific to database functions.
-type Database struct {
-	DbType   string `mapstructure:"dbtype"`
-	Host     string `mapstructure:"host"`
-	User     string `mapstructure:"user"`
-	Password string `mapstructure:"password"`
-	DB       string `mapstructure:"db"`
-}
-
 // Auth holds the configuration specific to the OAuth provider.
 type Auth struct {
 	OauthClientID     string            `mapstructure:"oauth_client_id"`
diff --git a/server/config/config_test.go b/server/config/config_test.go
index 067b0dca..6baf76d2 100644
--- a/server/config/config_test.go
+++ b/server/config/config_test.go
@@ -57,18 +57,3 @@ func TestSSHConfig(t *testing.T) {
 	}
 	a.Equal(d.Hours(), float64(720))
 }
-
-func TestDatabaseConfig(t *testing.T) {
-	a := assert.New(t)
-	c, err := ReadConfig(bytes.NewBuffer(testdata.Database))
-	if err != nil {
-		t.Fatal(err)
-	}
-	d := c.Database
-	a.IsType(d, Database{})
-	a.Equal(d.User, "user")
-	a.Equal(d.Password, "password")
-	a.Equal(d.Host, "localhost")
-	a.Equal(d.DbType, "mongo")
-	a.Equal(d.DB, "dbname")
-}
diff --git a/testdata/config.go b/testdata/config.go
index 8b38fa62..bb2f5111 100644
--- a/testdata/config.go
+++ b/testdata/config.go
@@ -30,13 +30,3 @@ var SSHConfig = []byte(`{
 		"permissions": ["permit-pty", "permit-X11-forwarding", "permit-port-forwarding", "permit-user-rc"]
 	}
 }`)
-
-var Database = []byte(`{
-	"database": {
-		"host": "localhost",
-		"user": "user",
-		"password": "password",
-		"db": "dbname",
-		"dbtype": "mongo"
-	}
-}`)
-- 
GitLab