Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Component Design

Kegsay edited this page Mar 13, 2017 · 12 revisions

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).

Clone this wiki locally