From 4b7475414d1eb1354f7c159682876e2a575577dd Mon Sep 17 00:00:00 2001 From: Kegsay Date: Mon, 13 Mar 2017 15:45:40 +0000 Subject: [PATCH] Created Component Design (markdown) --- Component-Design.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Component-Design.md diff --git a/Component-Design.md b/Component-Design.md new file mode 100644 index 0000000..bcdc8cf --- /dev/null +++ b/Component-Design.md @@ -0,0 +1,7 @@ +New components must be placed in a directory under https://github.com/matrix-org/dendrite/tree/master/src/github.com/matrix-org/dendrite. They must produce at least one binary file and be documented with a README at the top-level of its directory. + +New components may read from or write to Kafka logs. The expected input/output structs must be put in an `api` package. New components may also expose **internal** HTTP APIs. These APIs must also be put in the `api` package. Together, this forms the API for the component which other components can make use of. + +New components can share types/structs between each other by putting them inside https://github.com/matrix-org/dendrite/tree/master/src/github.com/matrix-org/dendrite/common. Be sparing about this: do not prematurely add code "just-in-case". + +New components may want to read or write to a database. This database should be Postgres 9.5+ unless there is an agreed upon reason not to. SQL statements should exist in `.go` files under a `storage` package. Each table should correspond directly to one `*_table.go` file, unless there is a compelling reason not to (e.g 2 very tightly coupled tables where the statements don't makes sense without the context of the other table). \ No newline at end of file