lichao
2021-04-21 3931f83205f153f2bc7fc36d1a894cdc3f14b4db
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
syntax = "proto3";
option optimize_for = LITE_RUNTIME;
option go_package="./bhome_msg";
 
// public messages
import "error_msg.proto";
 
package bhome_msg;
 
message BHAddress {
    bytes mq_id = 1; // mqid, uuid
    bytes ip = 2;   //
    int32 port = 3;
}
 
message ProcInfo
{
    bytes proc_id = 1; // serial number, maybe managed
    bytes name = 2;
    bytes public_info = 3; // maybe json.
    bytes private_info = 4; 
}
 
message MsgTopicList {
    repeated bytes topic_list = 1;
}
 
 
message MsgPublish {
    bytes topic = 1;
    bytes data = 2; 
}
 
message MsgCommonReply {
    ErrorMsg errmsg = 1;
}
 
message MsgRequestTopic {
    bytes topic = 1;
    bytes data = 2; 
}
 
message MsgRequestTopicReply {
    ErrorMsg errmsg = 1;
    bytes data = 2; 
}
 
message MsgRegister
{
    ProcInfo proc = 1;
    repeated BHAddress addrs = 2;
}
 
message MsgHeartbeat
{
    ProcInfo proc = 1;
}
 
message MsgQueryTopic {
    bytes topic = 1;
}
 
message MsgQueryTopicReply {
    ErrorMsg errmsg = 1;
    BHAddress address = 2;
}