summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/importer.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-07 16:16:40 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-08 00:34:53 (GMT)
commita1b290f026011276f9c16f6af390a2aceb2f9ccc (patch)
tree2f7be9167b918b16c82d3f71f057a610f6ca749e /src/helsinki.at/rhimport/importer.go
parent6e5d14f4a2189dbc0f0404c398d11878e356ecd7 (diff)
moved DB into seperate module
Diffstat (limited to 'src/helsinki.at/rhimport/importer.go')
-rw-r--r--src/helsinki.at/rhimport/importer.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/helsinki.at/rhimport/importer.go b/src/helsinki.at/rhimport/importer.go
index 95e3e73..5eea054 100644
--- a/src/helsinki.at/rhimport/importer.go
+++ b/src/helsinki.at/rhimport/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 {