diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-07 16:16:40 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-08 00:34:53 (GMT) |
commit | 02b42d386668926464fd166c6a2dde51246fd9df (patch) | |
tree | e89054358e5a65aa4021a6f2f0708e315434c06c /importer.go | |
parent | a1242a443a5c72ea3b851b8d886a82e0b9d42cf9 (diff) |
moved DB into seperate module
Diffstat (limited to 'importer.go')
-rw-r--r-- | importer.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/importer.go b/importer.go index 95e3e73..5eea054 100644 --- a/importer.go +++ b/importer.go @@ -34,7 +34,8 @@ import ( ) type ImportContext struct { - Conf *Config + *Config + *RDDB UserName string Password string Trusted bool @@ -50,9 +51,10 @@ type ImportContext struct { DeleteSourceFile bool } -func NewImportContext(conf *Config, user string, group string) *ImportContext { +func NewImportContext(conf *Config, rddb *RDDB, user string, group string) *ImportContext { ctx := new(ImportContext) - ctx.Conf = conf + ctx.Config = conf + ctx.RDDB = rddb ctx.UserName = user ctx.Password = "" ctx.Trusted = false @@ -74,7 +76,7 @@ func (ctx *ImportContext) getPassword(cached bool) (err error) { req.username = ctx.UserName req.cached = cached req.response = make(chan getPasswordResult) - ctx.Conf.getPasswordChan <- req + ctx.RDDB.getPasswordChan <- req res := <-req.response if res.err != nil { |