diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-31 09:46:40 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-31 09:46:40 (GMT) |
commit | 0ef8fcb03fc4f51b8bc6b1a24f2e964b6a03d50c (patch) | |
tree | d065a87002893b693e17f2fe503a6f9631564c2b /src/helsinki.at/rhimport/session_store.go | |
parent | 620d1b76807f6ecffda54347db7b58107d03c2a5 (diff) |
improved coding style
Diffstat (limited to 'src/helsinki.at/rhimport/session_store.go')
-rw-r--r-- | src/helsinki.at/rhimport/session_store.go | 28 |
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 } |