// GetSession retrieves the session information for the given name
GetSession retrieves the session information for the given name
// GetSession retrieves the session information for the given name
func GetSession(name string) SessionInfo {
	result := RedisClient.HGetAll("session:" + name)
	if result.Err() != nil {
		log.Println("Error while getting session: ")
		log.Println(result.Err())
		return SessionInfo{-1}
	}
	resultMap, err := result.Result()
	if err != nil {
		log.Println("Error while getting session: ")
		log.Println(err)
		return SessionInfo{-1}
	}
	retval := SessionInfo{-1}
	retval.UserID, err = strconv.Atoi(resultMap["userId"])
	if err != nil {
		return SessionInfo{-1}
	}
	return retval
}
func GetSession ( name string ) SessionInfo { result := RedisClient . HGetAll ( " " + name ) if result . Err ( ) != nil { log . Println ( " " ) log . Println ( result . Err ( ) ) return SessionInfo { - 1 } } resultMap , err := result . Result ( ) if err != nil { log . Println ( " " ) log . Println ( err ) return SessionInfo { - 1 } } retval := SessionInfo { - 1 } retval . UserID , err = strconv . Atoi ( resultMap [ " " ] ) if err != nil { return SessionInfo { - 1 } } return retval }
GetSession retrieves the session information for the given name
GetSession retrieves the session information for the given name