dendrite/publicroomsapi
Kiril Vladimiroff 59465746bc
Always defer *sql.Rows.Close and consult with Err
database/sql.Rows.Next() makes sure to call Close only after exhausting
result rows which would NOT happen when returning early from a bad Scan.
Close being idempotent makes it a great candidate to get always deferred
regardless of what happens later on the result set.

This change also makes sure call Err() after exhausting Next() and
propagate non-nil results from it as the documentation advises.

Closes #764

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>
2020-02-06 11:27:24 +02:00
..
consumers Implement storage interfaces (#841) 2020-01-03 14:07:05 +00:00
directory Implement storage interfaces (#841) 2020-01-03 14:07:05 +00:00
routing Implement storage interfaces (#841) 2020-01-03 14:07:05 +00:00
storage Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
types use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
publicroomsapi.go Wire up publicroomsapi for roomserver events (#851) 2020-01-24 17:11:20 +00:00
README.md use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00

Public rooms API

This server is responsible for serving requests hitting /publicRooms and /directory/list/room/{roomID} as per:

https://matrix.org/docs/spec/client_server/r0.2.0.html#listing-rooms