diff --git a/configuration/config.go b/configuration/config.go index 9222c84..0dbc8eb 100644 --- a/configuration/config.go +++ b/configuration/config.go @@ -30,10 +30,10 @@ import ( ) // Global configuration -var GolbalConfig *config.Config = nil +var GlobalConfig *config.Config = nil func InitConfig() error { - if GolbalConfig != nil { + if GlobalConfig != nil { return nil } @@ -128,25 +128,25 @@ func InitConfig() error { env := config.NewEnvironment(mappings) if _, err := os.Stat(*configFile); os.IsNotExist(err) { - GolbalConfig = config.NewConfig([]config.Provider{defaults, env}) + GlobalConfig = config.NewConfig([]config.Provider{defaults, env}) } else { yamlFile := config.NewYAMLFile(*configFile) - GolbalConfig = config.NewConfig([]config.Provider{defaults, yamlFile, env}) + GlobalConfig = config.NewConfig([]config.Provider{defaults, yamlFile, env}) } - err := GolbalConfig.Load() + err := GlobalConfig.Load() if err != nil { log.Fatal("failed to parse config") return err } - m, err := GolbalConfig.String("mode") + m, err := GlobalConfig.String("mode") if err != nil { return err } if m != "test" { - settings, _ := GolbalConfig.Settings() + settings, _ := GlobalConfig.Settings() log.Print("All settings:") for key, val := range settings { // TODO password settings should be excluded! @@ -165,31 +165,31 @@ func ConfigureBackend() (string, string, string, string, string, string, string, return "", "", "", "", "", "", "", err } - mode, err := GolbalConfig.String("mode") + mode, err := GlobalConfig.String("mode") if err != nil { log.Printf("Error reading mode from global configuration: %v, aborting.", err.Error()) return "", "", "", "", "", "", "", err } - baseHost, err := GolbalConfig.String("base.host") + baseHost, err := GlobalConfig.String("base.host") if err != nil { log.Printf("Error reading base.host from global configuration: %v, aborting.", err.Error()) return "", "", "", "", "", "", "", err } - basePath, err := GolbalConfig.String("base.path") + basePath, err := GlobalConfig.String("base.path") if err != nil { log.Printf("Error reading base.path from global configuration: %v, aborting.", err.Error()) return "", "", "", "", "", "", "", err } - port, err := GolbalConfig.String("port") + port, err := GlobalConfig.String("port") if err != nil { log.Printf("Error reading port from global configuration: %v, aborting.", err.Error()) return "", "", "", "", "", "", "", err } - AMQPhost, _ := GolbalConfig.String("amqp.host") - AMQPuser, _ := GolbalConfig.String("amqp.user") - AMQPpass, _ := GolbalConfig.String("amqp.pass") + AMQPhost, _ := GlobalConfig.String("amqp.host") + AMQPuser, _ := GlobalConfig.String("amqp.user") + AMQPpass, _ := GlobalConfig.String("amqp.pass") return mode, baseHost, basePath, port, AMQPhost, AMQPuser, AMQPpass, nil } diff --git a/database/database_test.go b/database/database_test.go index abf8a3b..9dfcb41 100644 --- a/database/database_test.go +++ b/database/database_test.go @@ -23,10 +23,11 @@ package database import ( "fmt" - "github.com/zpatrick/go-config" "os" "testing" + "github.com/zpatrick/go-config" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "github.com/stretchr/testify/assert" ) @@ -52,33 +53,33 @@ func TestInitDB(t *testing.T) { err = InitDB(ownconfig) assert.Error(t, err) - dbname, err := configuration.GolbalConfig.String("db.name") + dbname, err := configuration.GlobalConfig.String("db.name") assert.NoError(t, err) static["db.name"] = dbname ownconfig = config.NewConfig([]config.Provider{defaults, env}) err = InitDB(ownconfig) assert.Error(t, err) - dbhost, err := configuration.GolbalConfig.String("db.host") + dbhost, err := configuration.GlobalConfig.String("db.host") assert.NoError(t, err) static["db.host"] = dbhost ownconfig = config.NewConfig([]config.Provider{defaults, env}) err = InitDB(ownconfig) assert.Error(t, err) - dbuser, err := configuration.GolbalConfig.String("db.user") + dbuser, err := configuration.GlobalConfig.String("db.user") static["db.user"] = dbuser ownconfig = config.NewConfig([]config.Provider{defaults, env}) err = InitDB(ownconfig) assert.Error(t, err) - dbpass, err := configuration.GolbalConfig.String("db.pass") + dbpass, err := configuration.GlobalConfig.String("db.pass") static["db.pass"] = dbpass ownconfig = config.NewConfig([]config.Provider{defaults, env}) err = InitDB(ownconfig) assert.Error(t, err) - dbssl, err := configuration.GolbalConfig.String("db.ssl") + dbssl, err := configuration.GlobalConfig.String("db.ssl") assert.NoError(t, err) static["db.ssl"] = dbssl ownconfig = config.NewConfig([]config.Provider{defaults, env}) diff --git a/routes/component-configuration/config_test.go b/routes/component-configuration/config_test.go index 579f13c..1950896 100644 --- a/routes/component-configuration/config_test.go +++ b/routes/component-configuration/config_test.go @@ -23,17 +23,18 @@ package component_configuration import ( "fmt" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" + infrastructure_component "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/scenario" "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/user" "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "os" - "testing" ) var router *gin.Engine @@ -146,7 +147,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/dashboard/dashboard_test.go b/routes/dashboard/dashboard_test.go index e472ec4..a4c576b 100644 --- a/routes/dashboard/dashboard_test.go +++ b/routes/dashboard/dashboard_test.go @@ -23,6 +23,10 @@ package dashboard import ( "fmt" + "log" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" @@ -31,9 +35,6 @@ import ( "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "log" - "os" - "testing" ) var router *gin.Engine @@ -80,7 +81,7 @@ func TestMain(m *testing.M) { if err != nil { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/file/file_methods.go b/routes/file/file_methods.go index b0c5749..71a933c 100644 --- a/routes/file/file_methods.go +++ b/routes/file/file_methods.go @@ -98,7 +98,7 @@ func (f *File) Register(fileHeader *multipart.FileHeader, scenarioID uint) error } defer fileContent.Close() - bucket, err := configuration.GolbalConfig.String("s3.bucket") + bucket, err := configuration.GlobalConfig.String("s3.bucket") if bucket == "" { f.FileData, err = ioutil.ReadAll(fileContent) f.Key = "" @@ -157,7 +157,7 @@ func (f *File) update(fileHeader *multipart.FileHeader) error { } defer fileContent.Close() - bucket, err := configuration.GolbalConfig.String("s3.bucket") + bucket, err := configuration.GlobalConfig.String("s3.bucket") if bucket == "" { f.FileData, err = ioutil.ReadAll(fileContent) f.Key = "" diff --git a/routes/file/file_s3.go b/routes/file/file_s3.go index b51f724..047a279 100644 --- a/routes/file/file_s3.go +++ b/routes/file/file_s3.go @@ -40,7 +40,7 @@ var s3Session *session.Session = nil func getS3Session() (*session.Session, string, error) { - bucket, err := configuration.GolbalConfig.String("s3.bucket") + bucket, err := configuration.GlobalConfig.String("s3.bucket") if err != nil || bucket == "" { return nil, "", fmt.Errorf("no S3 bucket configured: %s", err) } @@ -57,10 +57,10 @@ func getS3Session() (*session.Session, string, error) { } func createS3Session() (*session.Session, error) { - endpoint, err := configuration.GolbalConfig.String("s3.endpoint") - region, err := configuration.GolbalConfig.String("s3.region") - pathStyle, err := configuration.GolbalConfig.Bool("s3.pathstyle") - nossl, err := configuration.GolbalConfig.Bool("s3.nossl") + endpoint, err := configuration.GlobalConfig.String("s3.endpoint") + region, err := configuration.GlobalConfig.String("s3.region") + pathStyle, err := configuration.GlobalConfig.Bool("s3.pathstyle") + nossl, err := configuration.GlobalConfig.Bool("s3.nossl") sess, err := session.NewSession( &aws.Config{ diff --git a/routes/file/file_test.go b/routes/file/file_test.go index 881371d..5f10771 100644 --- a/routes/file/file_test.go +++ b/routes/file/file_test.go @@ -24,6 +24,14 @@ package file import ( "bytes" "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "net/http/httptest" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" @@ -32,13 +40,6 @@ import ( "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/http/httptest" - "os" - "testing" ) var router *gin.Engine @@ -83,7 +84,7 @@ func TestMain(m *testing.M) { if err != nil { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/healthz/healthz_endpoint.go b/routes/healthz/healthz_endpoint.go index e9928ab..f93bc37 100644 --- a/routes/healthz/healthz_endpoint.go +++ b/routes/healthz/healthz_endpoint.go @@ -22,14 +22,15 @@ package healthz import ( - "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" - "github.com/gin-gonic/gin" "log" "net/http" "strings" + + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" + infrastructure_component "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" + "github.com/gin-gonic/gin" ) func RegisterHealthzEndpoint(r *gin.RouterGroup) { @@ -55,7 +56,7 @@ func getHealth(c *gin.Context) { } // check if connection to AMQP broker is alive if backend was started with AMQP client - url, err := configuration.GolbalConfig.String("amqp.host") + url, err := configuration.GlobalConfig.String("amqp.host") if err != nil && strings.Contains(err.Error(), "Required setting 'amqp.host' not set") { c.JSON(http.StatusOK, gin.H{}) return diff --git a/routes/healthz/healthz_test.go b/routes/healthz/healthz_test.go index 6bdada4..7d716ed 100644 --- a/routes/healthz/healthz_test.go +++ b/routes/healthz/healthz_test.go @@ -22,15 +22,16 @@ package healthz import ( - "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" - "github.com/gin-gonic/gin" - "github.com/stretchr/testify/assert" "log" "net/http" "testing" + + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" + infrastructure_component "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" ) var router *gin.Engine @@ -40,7 +41,7 @@ func TestHealthz(t *testing.T) { assert.NoError(t, err) // connect DB - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) assert.NoError(t, err) defer database.DBpool.Close() @@ -58,7 +59,7 @@ func TestHealthz(t *testing.T) { assert.Equalf(t, 500, code, "Response body: \n%v\n", resp) // reconnect DB - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) assert.NoError(t, err) defer database.DBpool.Close() @@ -68,11 +69,11 @@ func TestHealthz(t *testing.T) { assert.Equalf(t, 500, code, "Response body: \n%v\n", resp) // connect AMQP client (make sure that AMQP_HOST, AMQP_USER, AMQP_PASS are set via command line parameters) - host, err := configuration.GolbalConfig.String("amqp.host") + host, err := configuration.GlobalConfig.String("amqp.host") assert.NoError(t, err) - user, err := configuration.GolbalConfig.String("amqp.user") + user, err := configuration.GlobalConfig.String("amqp.user") assert.NoError(t, err) - pass, err := configuration.GolbalConfig.String("amqp.pass") + pass, err := configuration.GlobalConfig.String("amqp.pass") assert.NoError(t, err) amqpURI := "amqp://" + user + ":" + pass + "@" + host diff --git a/routes/infrastructure-component/ic_test.go b/routes/infrastructure-component/ic_test.go index 53c6058..186b9cb 100644 --- a/routes/infrastructure-component/ic_test.go +++ b/routes/infrastructure-component/ic_test.go @@ -24,15 +24,16 @@ package infrastructure_component import ( "encoding/json" "fmt" + "os" + "testing" + "time" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" component_configuration "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/component-configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/scenario" "github.com/jinzhu/gorm/dialects/postgres" "github.com/streadway/amqp" "github.com/stretchr/testify/assert" - "os" - "testing" - "time" "github.com/gin-gonic/gin" @@ -94,7 +95,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } @@ -126,9 +127,9 @@ func TestAddICAsAdmin(t *testing.T) { // connect AMQP client // Make sure that AMQP_HOST, AMQP_USER, AMQP_PASS are set - host, err := configuration.GolbalConfig.String("amqp.host") - user, err := configuration.GolbalConfig.String("amqp.user") - pass, err := configuration.GolbalConfig.String("amqp.pass") + host, err := configuration.GlobalConfig.String("amqp.host") + user, err := configuration.GlobalConfig.String("amqp.user") + pass, err := configuration.GlobalConfig.String("amqp.pass") amqpURI := "amqp://" + user + ":" + pass + "@" + host // AMQP Connection startup is tested here diff --git a/routes/register_test.go b/routes/register_test.go index 6d9c20b..625ed05 100644 --- a/routes/register_test.go +++ b/routes/register_test.go @@ -42,7 +42,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } @@ -51,9 +51,9 @@ func TestMain(m *testing.M) { router = gin.Default() // connect AMQP client (make sure that AMQP_HOST, AMQP_USER, AMQP_PASS are set via command line parameters) - host, err := configuration.GolbalConfig.String("amqp.host") - user, err := configuration.GolbalConfig.String("amqp.user") - pass, err := configuration.GolbalConfig.String("amqp.pass") + host, err := configuration.GlobalConfig.String("amqp.host") + user, err := configuration.GlobalConfig.String("amqp.user") + pass, err := configuration.GlobalConfig.String("amqp.pass") amqpURI := "amqp://" + user + ":" + pass + "@" + host @@ -76,6 +76,6 @@ func TestAddTestData(t *testing.T) { panic(t) } - resp, err := AddTestData(configuration.GolbalConfig, router) + resp, err := AddTestData(configuration.GlobalConfig, router) assert.NoError(t, err, "Response body: %v", resp) } diff --git a/routes/result/result_test.go b/routes/result/result_test.go index c57596e..853bcd4 100644 --- a/routes/result/result_test.go +++ b/routes/result/result_test.go @@ -26,6 +26,14 @@ import ( "bytes" "encoding/json" "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "net/http/httptest" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" @@ -35,13 +43,6 @@ import ( "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/http/httptest" - "os" - "testing" ) var router *gin.Engine @@ -98,7 +99,7 @@ func TestMain(m *testing.M) { if err != nil { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/scenario/scenario_test.go b/routes/scenario/scenario_test.go index 3b8e609..598e2aa 100644 --- a/routes/scenario/scenario_test.go +++ b/routes/scenario/scenario_test.go @@ -23,6 +23,9 @@ package scenario import ( "fmt" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" @@ -30,8 +33,6 @@ import ( "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "os" - "testing" ) var router *gin.Engine @@ -56,7 +57,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/signal/signal_test.go b/routes/signal/signal_test.go index 045d53c..6814667 100644 --- a/routes/signal/signal_test.go +++ b/routes/signal/signal_test.go @@ -23,18 +23,19 @@ package signal import ( "fmt" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/component-configuration" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" + component_configuration "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/component-configuration" + infrastructure_component "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/scenario" "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/user" "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "os" - "testing" ) var router *gin.Engine @@ -141,7 +142,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/user/authenticate_endpoint.go b/routes/user/authenticate_endpoint.go index 36dcfc2..f4bb1c7 100644 --- a/routes/user/authenticate_endpoint.go +++ b/routes/user/authenticate_endpoint.go @@ -88,7 +88,7 @@ func authenticate(c *gin.Context) { return } - expiresStr, err := configuration.GolbalConfig.String("jwt.expires-after") + expiresStr, err := configuration.GlobalConfig.String("jwt.expires-after") if err != nil { helper.UnauthorizedError(c, "Backend configuration error") return @@ -100,7 +100,7 @@ func authenticate(c *gin.Context) { return } - secret, err := configuration.GolbalConfig.String("jwt.secret") + secret, err := configuration.GlobalConfig.String("jwt.secret") if err != nil { helper.UnauthorizedError(c, "Backend configuration error") return diff --git a/routes/user/user_middleware.go b/routes/user/user_middleware.go index 78a7992..cc83006 100644 --- a/routes/user/user_middleware.go +++ b/routes/user/user_middleware.go @@ -68,7 +68,7 @@ func Authentication(unauthorized bool) gin.HandlerFunc { } // return secret in byte format - secret, _ := configuration.GolbalConfig.String("jwt.secret") + secret, _ := configuration.GlobalConfig.String("jwt.secret") return []byte(secret), nil }) diff --git a/routes/user/user_test.go b/routes/user/user_test.go index 80ea3da..c8f240d 100644 --- a/routes/user/user_test.go +++ b/routes/user/user_test.go @@ -56,7 +56,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/routes/widget/widget_test.go b/routes/widget/widget_test.go index 7ea06a4..1abf0aa 100644 --- a/routes/widget/widget_test.go +++ b/routes/widget/widget_test.go @@ -23,6 +23,9 @@ package widget import ( "fmt" + "os" + "testing" + "git.rwth-aachen.de/acs/public/villas/web-backend-go/configuration" "git.rwth-aachen.de/acs/public/villas/web-backend-go/database" "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" @@ -32,8 +35,6 @@ import ( "github.com/gin-gonic/gin" "github.com/jinzhu/gorm/dialects/postgres" "github.com/stretchr/testify/assert" - "os" - "testing" ) var router *gin.Engine @@ -105,7 +106,7 @@ func TestMain(m *testing.M) { panic(m) } - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { panic(m) } diff --git a/start.go b/start.go index 96b2219..ffcbd13 100644 --- a/start.go +++ b/start.go @@ -30,7 +30,7 @@ import ( apidocs "git.rwth-aachen.de/acs/public/villas/web-backend-go/doc/api" // doc/api folder is used by Swag CLI, you have to import it "git.rwth-aachen.de/acs/public/villas/web-backend-go/helper" "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes" - "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" + infrastructure_component "git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component" "github.com/gin-gonic/gin" "github.com/zpatrick/go-config" ) @@ -79,7 +79,7 @@ func main() { } //init database - err = database.InitDB(configuration.GolbalConfig) + err = database.InitDB(configuration.GlobalConfig) if err != nil { log.Printf("Error during initialization of database: %v, aborting.", err.Error()) panic(err) @@ -107,7 +107,7 @@ func main() { } // add data to DB (if any) - err = addData(r, configuration.GolbalConfig) + err = addData(r, configuration.GlobalConfig) if err != nil { panic(err) }