-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser-plugin.wit
More file actions
40 lines (32 loc) · 1.64 KB
/
parser-plugin.wit
File metadata and controls
40 lines (32 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package plotjuggler:schema-parser@0.1.0;
interface schema-parser {
/// Semicolon separated list of supported encodings
supported-encodings: func() -> string;
/// Get the configuration model describing the parameters accepted by the plugin
/// See PARAMETERS_MODEL.md for details
parameter-model-yaml: func(encoding: string) -> string;
/// The main parser resource that implements the parsing functionality
resource schema-parser {
/// Create a new parser instance
constructor();
/// Initialize the schema parser with the given parameters
///
/// msg-encoding: The encoding of the messages to parse (e.g. "json", "msgpack", "protobuf", "ros1msg", "ros2msg")
/// schema: The schema definition (unless it is schema-less, like JSON)
/// topic-type: The topic type (needed when schema contains more than one type, like protobuf, ROS1, ROS2)
/// parameters-yaml: Additional parameters serialized as a simple YAML
/// Returns: true on successful initialization, false otherwise
init: func(msg-encoding: string, schema: string, topic-type: string, parameters-yaml: string) -> bool;
/// Parse a message and return MessagePack serialized result
/// This is the key method, where the actual parsing happens
///
/// message: blob of data to parse
/// Returns: MessagePack encoded output or empty list on failure
parse-message: func(message: list<u8>) -> list<u8>;
}
}
/// World definition for a schema parser component
world schema-parser-world {
/// Export the schema-parser interface
export schema-parser;
}