1
0
Fork 0

Rename sessionID to sid

This commit is contained in:
Gregory Eremin 2015-03-07 22:04:28 +07:00
parent f33a44bb1f
commit 0896799a25
1 changed files with 9 additions and 9 deletions

View File

@ -13,10 +13,10 @@ import (
type (
request struct {
r *http.Request
w http.ResponseWriter
sessionID string
login string
r *http.Request
w http.ResponseWriter
sid string
login string
}
statRequest struct {
org string
@ -31,16 +31,16 @@ func parseRequest(w http.ResponseWriter, r *http.Request) (*request, *statReques
sid := sessionID(w, r)
login, _ := redis.String(redisPool.Get().Do("HGET", "sessions", sid))
req := &request{
r: r,
w: w,
sessionID: sid,
login: login,
r: r,
w: w,
sid: sid,
login: login,
}
return req, parseStatRequest(r)
}
func (r *request) authorize(login string) {
redisPool.Get().Do("HSET", "sessions", r.sessionID, login)
redisPool.Get().Do("HSET", "sessions", r.sid, login)
}
func (r *request) respondWith(resp interface{}) {