syntax = "proto3";

package transport;

option go_package = "/;transport";


// Frame headers

message System {
    string name = 1;
}

message Request {
    int64 id = 1;
    int64 address = 2;
    string request_rpc = 3;
    string trace_id = 4;
}

message Response {
    int64 id = 1;
    string response_rpc = 2;
    int64 address = 3;
    int64 err_code = 4;
    string err_msg = 5;
    string trace_id = 6;
}

message Event {
    int64 id = 1;
    string event_rpc = 2;
    string trace_id = 3;
}

message SyncError {
    int64 err_code = 1;
    string err_desc = 2;
}

// System RPC

message ClientInfo {
    enum Type {
        UNKNOWN = 0;
        SERVER = 1;
        CLIENT = 2;
        STANDALONE = 3;
    }
    Type type = 1;
    int32 class = 2;
    string name = 3;
    int32 version = 4;
}

message InitResponse {
    int64 addr = 1;
}

message GetClientsResponse {
    repeated int64 addresses = 1;
}

message SubInfo {
    ClientInfo client_info = 1;
    int64 address = 2;
    string eventType = 3;
}

message SubResult {
    int64 id = 1;
}

message Result {
    int64 result = 1;
}
