Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 1 | namespace aos; |
| 2 | |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 3 | // Table representing a channel. Channels are where data is published and |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 4 | // subscribed from. The tuple of name, type is the identifying information. |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 5 | table Channel { |
| 6 | // Name of the channel. |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 7 | name:string; |
| 8 | // Type name of the flatbuffer. |
| 9 | type:string; |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 10 | // Max frequency in messages/sec of the data published on this channel. |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 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 | |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 17 | // Table to support renaming channel names. |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 18 | table Map { |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 19 | // 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] | 20 | // with the name in rename. |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 21 | match:Channel; |
| 22 | // The channel to merge in. |
| 23 | rename:Channel; |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 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" } } ] |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 34 | // 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] | 35 | // this application. This is super handy for running an application twice |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 36 | // publishing to different channels, or for injecting a little application |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 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 { |
Austin Schuh | 40485ed | 2019-10-26 21:51:44 -0700 | [diff] [blame] | 50 | // List of channels. |
| 51 | channels:[Channel] (id: 0); |
Austin Schuh | cb10841 | 2019-10-13 16:09:54 -0700 | [diff] [blame] | 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; |