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