summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/session_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimport/session_store.go')
-rw-r--r--src/helsinki.at/rhimport/session_store.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/helsinki.at/rhimport/session_store.go b/src/helsinki.at/rhimport/session_store.go
index 9566293..bb4043b 100644
--- a/src/helsinki.at/rhimport/session_store.go
+++ b/src/helsinki.at/rhimport/session_store.go
@@ -131,7 +131,7 @@ func (self *SessionStore) new(ctx *ImportContext, refId string) (resp newSession
}
ctx.conf = self.conf
ctx.rddb = self.rddb
- s := &SessionStoreElement{NewSession(ctx, func() { self.GetInterface().Remove(ctx.UserName, resp.id) }), refId}
+ s := &SessionStoreElement{newSession(ctx, func() { self.GetInterface().Remove(ctx.UserName, resp.id) }), refId}
self.store[ctx.UserName][resp.id] = s
resp.session = self.store[ctx.UserName][resp.id].s.getInterface()
rhdl.Printf("SessionStore: created session for '%s' -> %s", ctx.UserName, resp.id)
@@ -179,7 +179,7 @@ func (self *SessionStore) remove(user, id string) (resp removeSessionResponse) {
resp.responsecode = http.StatusOK
resp.errorstring = "OK"
if session, exists := self.store[user][id]; exists {
- go session.s.Cleanup() // cleanup could take a while -> don't block all the other stuff
+ go session.s.cleanup() // cleanup could take a while -> don't block all the other stuff
delete(self.store[user], id)
rhdl.Printf("SessionStore: removed session '%s/%s'", user, id)
if userstore, exists := self.store[user]; exists {
@@ -224,51 +224,51 @@ type SessionStoreChan struct {
}
func (self *SessionStoreChan) New(ctx *ImportContext, refId string) (string, *SessionChan, int, string) {
- res_ch := make(chan newSessionResponse)
+ resCh := make(chan newSessionResponse)
req := newSessionRequest{}
req.ctx = ctx
req.refId = refId
- req.response = res_ch
+ req.response = resCh
self.newChan <- req
- res := <-res_ch
+ res := <-resCh
return res.id, res.session, res.responsecode, res.errorstring
}
func (self *SessionStoreChan) Get(user, id string) (*SessionChan, string, int, string) {
- res_ch := make(chan getSessionResponse)
+ resCh := make(chan getSessionResponse)
req := getSessionRequest{}
req.user = user
req.id = id
- req.response = res_ch
+ req.response = resCh
self.getChan <- req
- res := <-res_ch
+ res := <-resCh
return res.session, res.refId, res.responsecode, res.errorstring
}
func (self *SessionStoreChan) List(user, password string, trusted bool) (map[string]string, int, string) {
- res_ch := make(chan listSessionsResponse)
+ resCh := make(chan listSessionsResponse)
req := listSessionsRequest{}
req.user = user
req.password = password
req.trusted = trusted
- req.response = res_ch
+ req.response = resCh
self.listChan <- req
- res := <-res_ch
+ res := <-resCh
return res.sessions, res.responsecode, res.errorstring
}
func (self *SessionStoreChan) Remove(user, id string) (int, string) {
- res_ch := make(chan removeSessionResponse)
+ resCh := make(chan removeSessionResponse)
req := removeSessionRequest{}
req.user = user
req.id = id
- req.response = res_ch
+ req.response = resCh
self.removeChan <- req
- res := <-res_ch
+ res := <-resCh
return res.responsecode, res.errorstring
}