summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/conf.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimport/conf.go')
-rw-r--r--src/helsinki.at/rhimport/conf.go36
1 files changed, 1 insertions, 35 deletions
diff --git a/src/helsinki.at/rhimport/conf.go b/src/helsinki.at/rhimport/conf.go
index 2c91ed9..b7e8f88 100644
--- a/src/helsinki.at/rhimport/conf.go
+++ b/src/helsinki.at/rhimport/conf.go
@@ -24,10 +24,6 @@
package rhimport
-import (
- "github.com/vaughan0/go-ini"
-)
-
type ImportParamDefaults struct {
Channels uint
NormalizationLevel int
@@ -36,44 +32,14 @@ type ImportParamDefaults struct {
}
type Config struct {
- configfile string
RDXportEndpoint string
TempDir string
- dbHost string
- dbUser string
- dbPasswd string
- dbDb string
LocalFetchDir string
ImportParamDefaults
}
-func getIniValue(file ini.File, section string, key string, dflt string) string {
- value, ok := file.Get(section, key)
- if ok {
- return value
- }
- return dflt
-}
-
-func (self *Config) readConfigFile() error {
- file, err := ini.LoadFile(self.configfile)
- if err != nil {
- return err
- }
-
- self.dbHost = getIniValue(file, "mySQL", "Hostname", "localhost")
- self.dbUser = getIniValue(file, "mySQL", "Loginname", "rivendell")
- self.dbPasswd = getIniValue(file, "mySQL", "Password", "letmein")
- self.dbDb = getIniValue(file, "mySQL", "Database", "rivendell")
- return nil
-}
-
-func NewConfig(configfile, rdxportEndpoint, tempDir, localFetchDir string) (conf *Config, err error) {
+func NewConfig(rdxportEndpoint, tempDir, localFetchDir string) (conf *Config) {
conf = new(Config)
- conf.configfile = configfile
- if err = conf.readConfigFile(); err != nil {
- return
- }
conf.RDXportEndpoint = rdxportEndpoint
conf.TempDir = tempDir
conf.LocalFetchDir = localFetchDir