blob: a5cb59f504c124af3c8e6e0ef92d9ad06a889847 [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
18 // The schema for the data sent on this channel.
19 schema:reflection.Schema;
Austin Schuhcb108412019-10-13 16:09:54 -070020}
21
Austin Schuh40485ed2019-10-26 21:51:44 -070022// Table to support renaming channel names.
Austin Schuhcb108412019-10-13 16:09:54 -070023table Map {
Austin Schuh40485ed2019-10-26 21:51:44 -070024 // Channel to match with. If the name in here matches, the name is replaced
Austin Schuhcb108412019-10-13 16:09:54 -070025 // with the name in rename.
Austin Schuh40485ed2019-10-26 21:51:44 -070026 match:Channel;
27 // The channel to merge in.
28 rename:Channel;
Austin Schuhcb108412019-10-13 16:09:54 -070029}
30
31// Application specific information.
32table 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 Schuh40485ed2019-10-26 21:51:44 -070039 // will make it so any channels named "/foo" actually go to "/bar" for just
Austin Schuhcb108412019-10-13 16:09:54 -070040 // this application. This is super handy for running an application twice
Austin Schuh40485ed2019-10-26 21:51:44 -070041 // publishing to different channels, or for injecting a little application
Austin Schuhcb108412019-10-13 16:09:54 -070042 // 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.
54table Configuration {
Austin Schuh40485ed2019-10-26 21:51:44 -070055 // List of channels.
56 channels:[Channel] (id: 0);
Austin Schuhcb108412019-10-13 16:09:54 -070057 // 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
66root_type Configuration;