Skip to content

Instantly share code, notes, and snippets.

@jimevans
Created May 12, 2011 15:42
Show Gist options
  • Save jimevans/968789 to your computer and use it in GitHub Desktop.
Save jimevans/968789 to your computer and use it in GitHub Desktop.
syntax = scope;
enum STPType
{
COMMAND = 1;
RESPONSE = 2;
EVENT = 3;
ERROR = 4;
}
message TransportMessage
{
required string service = 1;
required uint32 commandID = 2;
required uint32 format = 3;
optional uint32 status = 4;
optional uint32 tag = 5;
required bytes payload = 8;
}
message Command
{
required string service = 1;
required uint32 commandID = 2;
required uint32 format = 3;
required uint32 tag = 5;
required bytes payload = 8;
}
message Response
{
required string service = 1;
required uint32 commandID = 2;
required uint32 format = 3;
required uint32 tag = 5;
required bytes payload = 8;
}
message Event
{
required string service = 1;
required uint32 commandID = 2;
required uint32 format = 3;
required bytes payload = 8;
}
message Error
{
required string service = 1;
required uint32 commandID = 2;
required uint32 format = 3;
optional uint32 status = 4;
optional uint32 tag = 5;
}
enum Status
{
OK = 0;
BAD_REQUEST = 3;
INTERNAL_ERROR = 4;
COMMAND_NOT_FOUND = 5;
SERVICE_NOT_FOUND = 6;
OUT_OF_MEMORY = 7;
SERVICE_NOT_ENABLED = 8;
SERVICE_ALREADY_ENABLED = 9;
}
message ErrorInfo
{
optional string description = 1;
optional sint32 line = 2;
optional sint32 column = 3;
optional sint32 offset = 4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment