|
@@ -7,15 +7,16 @@ import (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
var (
|
|
|
- Conf *Configuration
|
|
|
|
|
|
|
+ Conf *Configuration // store configuration for global access
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
type Configuration struct {
|
|
type Configuration struct {
|
|
|
- DBHost string
|
|
|
|
|
- DBUser string
|
|
|
|
|
- DBPass string
|
|
|
|
|
- DBName string
|
|
|
|
|
- CryptoKey string
|
|
|
|
|
|
|
+ DBHost string
|
|
|
|
|
+ DBUser string
|
|
|
|
|
+ DBPass string
|
|
|
|
|
+ DBName string
|
|
|
|
|
+ CryptoKey string
|
|
|
|
|
+ // TODO dynamic fields
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func ReadConfig(filename string) Configuration {
|
|
func ReadConfig(filename string) Configuration {
|
|
@@ -27,7 +28,7 @@ func ReadConfig(filename string) Configuration {
|
|
|
fmt.Println("error:", err)
|
|
fmt.Println("error:", err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- fmt.Printf("%#v", configuration)
|
|
|
|
|
|
|
+ //fmt.Printf("%#v", configuration) // DEBUG
|
|
|
|
|
|
|
|
return configuration
|
|
return configuration
|
|
|
}
|
|
}
|