Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 1 | namespace aos; |
| 2 | |
| 3 | // Table representing a location. Locations are where data is published and |
| 4 | // subscribed from. The tuple of name, type is the identifying information. |
| 5 | table Location { |
| 6 | // Name of the location. |
| 7 | name:string; |
| 8 | // Type name of the flatbuffer. |
| 9 | type:string; |
| 10 | // Max frequency in messages/sec of the data published on this location. |
| 11 | frequency:int = 100; |
| 12 | // Max size of the data being published. (This will be automatically |
| 13 | // computed in the future.) |
| 14 | max_size:int = 1000; |
| 15 | } |
| 16 | |
| 17 | // Table to support renaming location names. |
| 18 | table Map { |
| 19 | // Location to match with. If the name in here matches, the name is replaced |
| 20 | // with the name in rename. |
| 21 | match:Location; |
| 22 | // The location to merge in. |
| 23 | rename:Location; |
| 24 | } |
| 25 | |
| 26 | // Application specific information. |
| 27 | table Application { |
| 28 | // Name of the application. |
| 29 | name:string; |
| 30 | // List of maps to apply for this specific application. Application specific |
| 31 | // maps are applied in reverse order, and before the global maps. |
| 32 | // For example |
| 33 | // "maps": [ { "match": { "name": "/foo" }, "rename": { "name": "/bar" } } ] |
| 34 | // will make it so any locations named "/foo" actually go to "/bar" for just |
| 35 | // this application. This is super handy for running an application twice |
| 36 | // publishing to different locations, or for injecting a little application |
| 37 | // to modify messages live for testing. |
| 38 | // |
| 39 | // "maps": [ |
| 40 | // { "match": { "name": "/foo" }, "rename": { "name": "/bar" } }, |
| 41 | // { "match": { "name": "/foo" }, "rename": { "name": "/baz" } } |
| 42 | // ] |
| 43 | // |
| 44 | // will map "/foo" to "/baz", even if there is a global list of maps. |
| 45 | maps:[Map]; |
| 46 | } |
| 47 | |
| 48 | // Overall configuration datastructure for the pubsub. |
| 49 | table Configuration { |
| 50 | // List of locations. |
| 51 | locations:[Location] (id: 0); |
| 52 | // List of global maps. These are applied in reverse order. |
| 53 | maps:[Map] (id: 1); |
| 54 | // List of applications. |
| 55 | applications:[Application] (id: 2); |
| 56 | // List of imports. Imports are loaded first, and then this configuration |
| 57 | // is merged into them. |
| 58 | imports:[string] (id: 3); |
| 59 | } |
| 60 | |
| 61 | root_type Configuration; |