mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-27 00:31:55 -06:00
4f943771fa
Rebase of #2936 as @vijfhoek wrote he got no time to work on this, and I kind of needed it for my experiments. I checked the tests, and it is working with my example code (i.e. impersonating, registering, creating channel, invite people, write messages). I'm not a huge `go` pro, and still learning, but I tried to fix and/or integrate the changes as best as possible with the current `main` branch changes. If there is anything left, let me know and I'll try to figure it out. Signed-off-by: `Kuhn Christopher <kuhnchris+git@kuhnchris.eu>` --------- Signed-off-by: Sijmen <me@sijman.nl> Signed-off-by: Sijmen Schoon <me@sijman.nl> Co-authored-by: Sijmen Schoon <me@sijman.nl> Co-authored-by: Sijmen Schoon <me@vijf.life> Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com> |
||
---|---|---|
.. | ||
api | ||
auth | ||
httputil | ||
producers | ||
routing | ||
threepid | ||
userutil | ||
admin_test.go | ||
clientapi.go | ||
clientapi_test.go | ||
README.md |
This component roughly corresponds to "Client Room Send" and "Client Sync" on the WIRING diagram. This component produces multiple binaries.
Internals
- HTTP routing is done using
gorilla/mux
and the routing paths are in therouting
package.
Writers
- Each HTTP "write operation" (
/createRoom
,/rooms/$room_id/send/$type
, etc) is contained entirely to a single file in thewriters
package. - This file contains the request and response
struct
definitions, as well as aValidate() bool
function to validate incoming requests. - The entry point for each write operation is a stand-alone function as this makes testing easier. All dependencies should be injected into this function, including server keys/name, etc.