liuxiaolong
2022-01-05 27d8bc7cad4a8f68c2da3efbb77f45ec70ae40e6
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
syntax = "proto3";
option optimize_for = LITE_RUNTIME;
option go_package="./bhome_msg";
 
// public messages
import "error_msg.proto";
 
package bhome_msg;
 
message BHAddress {
    uint64 mq_id = 1;
    int64 abs_addr = 2;
    bytes ip = 3;   
    int32 port = 4;
}
 
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;
}
 
message MsgUnregister
{
    ProcInfo proc = 1;
}
 
message MsgHeartbeat
{
    ProcInfo proc = 1;
}
 
message MsgQueryTopic {
    bytes topic = 1;
}
 
message MsgQueryTopicReply {
    ErrorMsg errmsg = 1;
 
message BHNodeAddress {
    bytes proc_id = 1;
    BHAddress addr = 2;
}
    repeated BHNodeAddress node_address = 2;
}
 
message MsgQueryProc {
    bytes proc_id = 1;
}
 
message MsgQueryProcReply {
    ErrorMsg errmsg = 1;
    message Info {
        ProcInfo proc  = 1;
        bool online = 2;
        MsgTopicList topics = 3;
        MsgTopicList subLocalTopics = 4;
        MsgTopicList subNetTopics = 5;
    }
    repeated Info proc_list = 2;
}