blob: d23c4b913657ea14bac3c0c8c96d888a2fe32c92 [file] [log] [blame]
Austin Schuhcb108412019-10-13 16:09:54 -07001namespace aos;
2
Austin Schuh40485ed2019-10-26 21:51:44 -07003// Table representing a channel. Channels are where data is published and
Austin Schuhcb108412019-10-13 16:09:54 -07004// subscribed from. The tuple of name, type is the identifying information.
Austin Schuh40485ed2019-10-26 21:51:44 -07005table Channel {
6 // Name of the channel.
Austin Schuhcb108412019-10-13 16:09:54 -07007 name:string;
8 // Type name of the flatbuffer.
9 type:string;
Austin Schuh40485ed2019-10-26 21:51:44 -070010 // Max frequency in messages/sec of the data published on this channel.
Austin Schuhcb108412019-10-13 16:09:54 -070011 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 Schuh40485ed2019-10-26 21:51:44 -070017// Table to support renaming channel names.
Austin Schuhcb108412019-10-13 16:09:54 -070018table Map {
Austin Schuh40485ed2019-10-26 21:51:44 -070019 // Channel to match with. If the name in here matches, the name is replaced
Austin Schuhcb108412019-10-13 16:09:54 -070020 // with the name in rename.
Austin Schuh40485ed2019-10-26 21:51:44 -070021 match:Channel;
22 // The channel to merge in.
23 rename:Channel;
Austin Schuhcb108412019-10-13 16:09:54 -070024}
25
26// Application specific information.
27table 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 Schuh40485ed2019-10-26 21:51:44 -070034 // will make it so any channels named "/foo" actually go to "/bar" for just
Austin Schuhcb108412019-10-13 16:09:54 -070035 // this application. This is super handy for running an application twice
Austin Schuh40485ed2019-10-26 21:51:44 -070036 // publishing to different channels, or for injecting a little application
Austin Schuhcb108412019-10-13 16:09:54 -070037 // 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.
49table Configuration {
Austin Schuh40485ed2019-10-26 21:51:44 -070050 // List of channels.
51 channels:[Channel] (id: 0);
Austin Schuhcb108412019-10-13 16:09:54 -070052 // 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
61root_type Configuration;