__init__.py 1.72 KB
Newer Older
1 2 3 4 5 6 7 8
import os


__all__ = [
    os.path.splitext(os.path.basename(x))[0]
    for x in os.listdir(os.path.dirname(__file__))
    if x.endswith(".py") and x != "__init__.py"
]
9

10
message_header = {
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    "type": "object",
    "discriminator": {
        "propertyName": "message_type",
    },
    "properties": {
        "message_ID": {
            "type": "string",
            "description": "An identifier for the type of message received.",
            "example": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
        },
        "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of message",
            "example": "2022-11-16T00:00:00Z",
        },
        "version": {
            "type": "number",
            "format": "float",
            "description": "Version of comms backbone message format protocol",
            "example": 2.0,
        },
        "source": {
            "type": "string",
            "description": "The sender; Where is this message from",
            "example": "autonomy_engine",
        },
        "destination": {
            "type": "string",
            "description": "Publisher topic; What is the destination"
            + " of this message",
            "example": "ah1",
        },
        "encoded": {
            "type": "boolean",
            "description": "Indicate that message raw (encoded) or decoded. "
            + "Options: encoded=True, decoded=False",
            "example": False,
        },
        "delivery_type": {
            "type": "string",
            "description": "To publish or broadcast this message.",
            "enum": ["broadcast", "publish"],
            "example": "publish",
            "default": "publish",
        },
    },
58
}