Commit Graph

12 Commits (d09a65abbe36c6f585fe65ea963ecfff3b3ecbd3)

Author SHA1 Message Date
Robert Swain d09a65abbe Add Apache Version 2.0 license and headers to all golang files 2017-04-21 00:40:52 +02:00
Kegsay a974b90ee9 Factor out Consumer from the roomserver (#50) 2017-03-27 10:00:28 +01:00
Mark Haines e667f17e14 Include the requested current state alongside the latest events in the query API. (#30)
* Return the requested portions of current state in the query API

* Use Unique from github.com/matrix-org/util

* rewrite bulkSelectFilteredStateBlockEntries to use append for clarity

* Add test for stateKeyTupleSorter

* Replace current with a new StateEntryList rather than individually setting the fields
2017-03-09 15:07:18 +00:00
Mark Haines 96fc9294cc Track the current state of the room (#24)
* Add method for calculating the room state after a list of events

* Fill out AddsState and RemovesState fields in the output event

* comment on return value

* Fix whitespace

* Clarify the meaning of LastEventIDSent

* Be more explicit on what the snapshot is

* Fix comments

* Comment on why we want the state after the previous events
2017-03-07 10:25:01 +00:00
Mark Haines 9a8a8aedcb Add a query API to the roomserver for getting the latest events in a room. (#23)
* Start implementing a query API for go using net/rpc

* Use a conventional JSON POST API rather than go net/rpc

net/rpc doesn't automatically handle reconnecting and we have better
logging and metrics infrastructure for monitoring HTTP apis.

* Implement the query API and add it to the integration tests

* Increase the timeout, travis seems to be a bit slow

* Clarify that state events are the things that are not returned if they are not requested

* Add utility function for converting arrays of numeric event IDs to pq Int64Arrays

* Warn people against requesting empty state keys by accident
2017-03-06 14:29:39 +00:00
Mark Haines 237b912cf5 Write to an output kafka log for new room events in the roomserver. (#20)
* Track which events have been sent and the last event sent for each room

* Write output events

* comment that an event could be sent twice
2017-02-27 11:25:35 +00:00
Mark Haines a9b296c522 Get the SQL working, and make it more idempotent (#17)
* Get the SQL working, and make it more idempotent
2017-02-22 16:51:10 +00:00
Mark Haines 51f9741b34 Track which events are the latest events in the room. (#14)
* Track which events are the latest events in the room.
2017-02-21 14:50:30 +00:00
Mark Haines 39264cbf4b Calculate and store the state at each event (#6)
* Calculate and store the state at each event

* Use type aliases for numeric IDs
2017-02-15 11:05:45 +00:00
Mark Haines fc4eb85379 Check that events pass authentication checks. (#4)
* Check that events pass authentication checks.

Record the list of events that the event passes authentication checks
against.
2017-02-09 16:48:14 +00:00
Mark Haines 600f56b4b8 Store outlier room events. (#3)
* Storage functions for event types
* Consume outlier room events
2017-02-07 17:20:05 +00:00
Mark Haines 41c6a3737e A kafkaesque room event consumer for the roomserver. (#1)
* A kafkaesque room event consumer for the roomserver.

Implement the main input loop for the roomserver.

It will receive events from a kafkaesque event source and track
where it is in the stream.

It currently does nothing with the events it consumes.
2017-02-03 13:52:32 +00:00