-
Notifications
You must be signed in to change notification settings - Fork 2
Code Overview
Services produces a single monolithic binary containing both the appointment as well as the storage servers (both provide webrtc as well as rest interfaces) as well as several tools designed to be invoked from the cli for service administration and benchmarking.
Here's a rough overview over the code base in order to give future developers a quick head start on how the code is organized.
Most future work will probably take place by modifying existing or adding new endpoint. These are implemented in the servers package. The Files starting with app contain general appointemnt endpoints and those starting with sto related to the storage server.
Endpoints need further be registered by adding an entry to the appropriate API struct in either appointments.go or storage.go
Incoming JSON data is verified by definitions from the forms package. Forms regarding return values seem only to serve documentation purposes.
The database is accessed through several abstraction layers.
The top layer is found in app_backend.go in the servers package, while locking facilities are provided in the app_locking.go file in the same package.
Lower level abstraction is implemented in the databases package with the database drivers directly underneath.
A database agnostic architecture was attempted, with redis already fully realized. A second database interface for sqlite as an in memory database was prepared but never implemented.
There's also been considerable effort to implement a PostgeSQL backend.
Since the abstraction layer seems tailored towards key-value stores, a comprehensive refactor was necessary.
That work was therefore split from the main repository and placed in the feat/śql branch.
It is about 90% complete.
The main package can be found under cmd/kiebitz/main.go with all of the argument parsing and cli command dispatching residing in cmd/helpers