Description
[Short description of problem here]
Add support to store API Spec in Cassandra.
This is similar to the Mongo approach.
The MongoDB Repo is implemented here.
https://github.com/motiv-labs/janus/blob/master/pkg/api/mongodb_repository.go
Here you can see where the Repository is setup
Line 45 in 9998651
Need to load a configured SQL file on first time start. We can do this like we do for other microservices here at Motiv. The file will have to be placed inside the Container. The default will be the basic schema but one could be added that has default definitions
** Things to be aware of
Need to test to make sure a cluster of Januses will work. Obviously all pointed at the same Cassandra Ring.
Make sure watch works and you can add new API Definitions get propagated to all connected Janus containers
Config of Cassandra and Janus should be able to be controlled via Environment Variables passed into the Docker container. Ultimatly we might need to create a card to update this for Mongo also.
[database]
dsn = "cassandra:......:user..."
** More code to be aware of
Definitions are stored here for APIs
Line 19 in 9998651
Line 18 in 9998651
The file_repo impl
janus/pkg/api/file_repository.go
Line 11 in 9998651
The in_memory repo
https://github.com/motiv-labs/janus/blob/master/pkg/api/in_memory_repository.go#L28
Where the watcher is hooked up. This should be the thing that allows everything to reload.
Line 216 in 9998651
How mongo is unmarshalling the JSON. In mongo it is simply key/value. So all the structs are a big JSON Object
Line 146 in 9998651
Line 146 in 9998651