blob: a9e71eaad7fc96eedb2f4933fce838aa62067a14 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001include "reflection/reflection.fbs";
2
Austin Schuhcb108412019-10-13 16:09:54 -07003namespace aos;
4
Austin Schuh40485ed2019-10-26 21:51:44 -07005// Table representing a channel. Channels are where data is published and
Austin Schuhcb108412019-10-13 16:09:54 -07006// subscribed from. The tuple of name, type is the identifying information.
Austin Schuh40485ed2019-10-26 21:51:44 -07007table Channel {
8 // Name of the channel.
Austin Schuhcb108412019-10-13 16:09:54 -07009 name:string;
10 // Type name of the flatbuffer.
11 type:string;
Austin Schuh40485ed2019-10-26 21:51:44 -070012 // Max frequency in messages/sec of the data published on this channel.
Austin Schuhcb108412019-10-13 16:09:54 -070013 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 Perrycb7da4b2019-08-28 19:35:56 -070017
Austin Schuh80c7fce2019-12-05 20:48:43 -080018 // Sets the maximum number of senders on a channel.
19 num_senders:int = 10;
20 // Sets the maximum number of watchers on a channel.
21 num_watchers:int = 10;
22
Alex Perrycb7da4b2019-08-28 19:35:56 -070023 // The schema for the data sent on this channel.
24 schema:reflection.Schema;
Austin Schuhcb108412019-10-13 16:09:54 -070025}
26
Austin Schuh40485ed2019-10-26 21:51:44 -070027// Table to support renaming channel names.
Austin Schuhcb108412019-10-13 16:09:54 -070028table Map {
Austin Schuh40485ed2019-10-26 21:51:44 -070029 // Channel to match with. If the name in here matches, the name is replaced
Austin Schuhcb108412019-10-13 16:09:54 -070030 // with the name in rename.
Austin Schuh40485ed2019-10-26 21:51:44 -070031 match:Channel;
32 // The channel to merge in.
33 rename:Channel;
Austin Schuhcb108412019-10-13 16:09:54 -070034}
35
36// Application specific information.
37table Application {
38 // Name of the application.
39 name:string;
40 // List of maps to apply for this specific application. Application specific
41 // maps are applied in reverse order, and before the global maps.
42 // For example
43 // "maps": [ { "match": { "name": "/foo" }, "rename": { "name": "/bar" } } ]
Austin Schuh40485ed2019-10-26 21:51:44 -070044 // will make it so any channels named "/foo" actually go to "/bar" for just
Austin Schuhcb108412019-10-13 16:09:54 -070045 // this application. This is super handy for running an application twice
Austin Schuh40485ed2019-10-26 21:51:44 -070046 // publishing to different channels, or for injecting a little application
Austin Schuhcb108412019-10-13 16:09:54 -070047 // to modify messages live for testing.
48 //
49 // "maps": [
50 // { "match": { "name": "/foo" }, "rename": { "name": "/bar" } },
51 // { "match": { "name": "/foo" }, "rename": { "name": "/baz" } }
52 // ]
53 //
54 // will map "/foo" to "/baz", even if there is a global list of maps.
55 maps:[Map];
56}
57
58// Overall configuration datastructure for the pubsub.
59table Configuration {
Austin Schuh40485ed2019-10-26 21:51:44 -070060 // List of channels.
61 channels:[Channel] (id: 0);
Austin Schuhcb108412019-10-13 16:09:54 -070062 // List of global maps. These are applied in reverse order.
63 maps:[Map] (id: 1);
64 // List of applications.
65 applications:[Application] (id: 2);
66 // List of imports. Imports are loaded first, and then this configuration
67 // is merged into them.
68 imports:[string] (id: 3);
69}
70
71root_type Configuration;