MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / GetSession

Function GetSession

cmd/cql-proxy/model/session.go:302–316  ·  view source on GitHub ↗

GetSession returns session object of specified session id.

(db *gorp.DbMap, id string)

Source from the content-addressed store, hash-verified

300
301// GetSession returns session object of specified session id.
302func GetSession(db *gorp.DbMap, id string) (s *Session, err error) {
303 err = db.SelectOne(&s,
304 `SELECT * FROM "session" WHERE "id" = ? LIMIT 1`, id)
305 if err != nil {
306 err = errors.Wrapf(err, "get session failed")
307 return
308 }
309 err = s.Deserialize()
310 if err != nil {
311 err = errors.Wrapf(err, "decode session failed")
312 return
313 }
314
315 return
316}
317
318// SaveSession saves session object to database.
319func SaveSession(db *gorp.DbMap, s *Session, expire int64) (r *Session, err error) {

Callers 2

userSessionInjectFunction · 0.92
adminSessionInjectFunction · 0.92

Calls 1

DeserializeMethod · 0.45

Tested by

no test coverage detected