mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 17:01:32 +00:00
Document TFW message format in README
This commit is contained in:
parent
db1b008fc9
commit
3f36826597
26
README.md
26
README.md
@ -50,6 +50,32 @@ This includes context-dependent hints and the automatic typing of commands to a
|
||||
|
||||
Note that our frontend implementation is written in Angular. It is maintained and documented in the `frontend-tutorial-framework` repository.
|
||||
|
||||
### Messaging format
|
||||
|
||||
The framework uses JSON messages internally and in exposed APIs as well.
|
||||
These messages must comply some rules.
|
||||
Don't worry, we are not too fond of rules around these parts.
|
||||
|
||||
The TFW message format:
|
||||
|
||||
```json
|
||||
{
|
||||
"key: "some identifier used for addressing",
|
||||
"data":
|
||||
{
|
||||
...
|
||||
JSON object carrying anything, preferably cats
|
||||
...
|
||||
},
|
||||
"trigger": "FSM action"
|
||||
}
|
||||
```
|
||||
|
||||
- The `key` field is used by TFW for addressing and every message must have one (it can be an empty string though)
|
||||
- The `data` object can contain anything you might want to send
|
||||
- The `trigger` key is an optional field that triggers an FSM action with that name from the current state (whatever that might be)
|
||||
|
||||
|
||||
## Where to go next
|
||||
|
||||
Most of the components you need have docstrings included (hang on tight, this is work in progress) – refer to them for usage info.
|
||||
|
Loading…
Reference in New Issue
Block a user