mao-service-discovery 1.6.0-commit-2023-07-24-04-37-15.0 → 1.6.0-commit-2023-07-24-06-22-14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/MaoServerDiscovery +0 -0
  2. package/package.json +1 -1
  3. package/.github/dependabot.yml +0 -11
  4. package/.github/workflows/codeql-analysis.yml +0 -75
  5. package/.github/workflows/docker-image.yml +0 -24
  6. package/.github/workflows/docker-publish.yml +0 -94
  7. package/.github/workflows/go.yml +0 -29
  8. package/.github/workflows/go_static.yml +0 -29
  9. package/.github/workflows/npm-publish-release.yml +0 -36
  10. package/.github/workflows/npm-publish.yml +0 -32
  11. package/Dockerfile +0 -19
  12. package/LICENSE +0 -201
  13. package/MODULES.md +0 -39
  14. package/README.md +0 -54
  15. package/bak/index.html +0 -42
  16. package/bak/receiveProcessIcmpLoopV4V6.bak +0 -73
  17. package/bak/test/test-icmp-ka-module.go +0 -297
  18. package/bak/test/test-tech.go +0 -110
  19. package/bak/using_etcd/main.go +0 -165
  20. package/cmd/api/aux-data-module.go +0 -14
  21. package/cmd/api/config-module.go +0 -11
  22. package/cmd/api/email-module.go +0 -14
  23. package/cmd/api/gateway-module.go +0 -23
  24. package/cmd/api/grpc-ka-module.go +0 -29
  25. package/cmd/api/icmp-ka-module.go +0 -26
  26. package/cmd/api/restful-server-module.go +0 -13
  27. package/cmd/api/topo-module.go +0 -31
  28. package/cmd/api/wechat-module.go +0 -18
  29. package/cmd/general_client.go +0 -366
  30. package/cmd/lib/AuxDataProcessor/aux-data-processor-module.go +0 -64
  31. package/cmd/lib/AuxDataProcessor/env-temp-processor.go +0 -63
  32. package/cmd/lib/AuxDataProcessor/env-temp-processor_test.go +0 -30
  33. package/cmd/lib/Config/config-yaml-module.go +0 -303
  34. package/cmd/lib/Config/config-yaml-module_test.go +0 -308
  35. package/cmd/lib/Email/login-auth.go +0 -35
  36. package/cmd/lib/Email/login-auth_test.go +0 -13
  37. package/cmd/lib/Email/smtp-email-module.go +0 -229
  38. package/cmd/lib/Email/smtp-email-module_test.go +0 -12
  39. package/cmd/lib/GrpcKa/grpc-detect-module.go +0 -269
  40. package/cmd/lib/GrpcKa/grpc-detect-module_test.go +0 -26
  41. package/cmd/lib/IcmpKa/icmp-detect-module.go +0 -545
  42. package/cmd/lib/IcmpKa/icmp-detect-module_test.go +0 -23
  43. package/cmd/lib/InfluxDB/influxdb-util.go +0 -72
  44. package/cmd/lib/MaoCommon/gps.go +0 -15
  45. package/cmd/lib/MaoCommon/service-registry-util.go +0 -59
  46. package/cmd/lib/MaoCommon/service-registry.go +0 -14
  47. package/cmd/lib/MaoCommon/service-registry_test.go +0 -30
  48. package/cmd/lib/MaoEnhancedGolang/smtp.go +0 -438
  49. package/cmd/lib/Restful/restful-server-impl.go +0 -87
  50. package/cmd/lib/Soap/soap-tplink-util.go +0 -186
  51. package/cmd/lib/Soap/soap-tplink-util_test.go +0 -45
  52. package/cmd/lib/Soap/tplink-gateway-module.go +0 -200
  53. package/cmd/server.go +0 -327
  54. package/go.mod +0 -38
  55. package/go.sum +0 -222
  56. package/grpc.maojianwei.com/server/discovery/api/generate_api_from_protobuf.sh +0 -1
  57. package/grpc.maojianwei.com/server/discovery/api/mao-server-discovery.pb.go +0 -403
  58. package/grpc.maojianwei.com/server/discovery/api/mao-server-discovery.proto +0 -35
  59. package/grpc.maojianwei.com/server/discovery/api/mao-server-discovery_grpc.pb.go +0 -207
  60. package/incubator/OnosTopoShow/onos-topo-module.go +0 -347
  61. package/incubator/Wechat/wechat-message-module.go +0 -267
  62. package/incubator/Wechat/wechat-message-module_test.go +0 -108
  63. package/main.go +0 -383
  64. package/notebook/notebook.txt +0 -8
  65. package/resource/index-email.html +0 -67
  66. package/resource/index-icmp.html +0 -41
  67. package/resource/index-onos.html +0 -38
  68. package/resource/index-server.html +0 -57
  69. package/resource/index-wechat.html +0 -64
  70. package/resource/jquery-3.6.0.min.js +0 -2
  71. package/screenshot/2-cli-output.png +0 -0
  72. package/screenshot/2-cli-parameters.png +0 -0
  73. package/screenshot/2-json-format.png +0 -0
  74. package/screenshot/2-readable-format.png +0 -0
  75. package/screenshot/client-server-mode-1.png +0 -0
  76. package/screenshot/client-server-mode-2.png +0 -0
  77. package/screenshot/client-server-mode-production.png +0 -0
  78. package/screenshot/show_using_etcd.png +0 -0
  79. package/statically_linked_compilation.sh +0 -2
  80. package/util/mao_log.go +0 -42
  81. package/util/mao_log_test.go +0 -73
  82. package/util/mao_util.go +0 -53
@@ -1,403 +0,0 @@
1
- // Code generated by protoc-gen-go. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-go v1.26.0
4
- // protoc v3.17.0
5
- // source: mao-server-discovery.proto
6
-
7
- package api
8
-
9
- import (
10
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
- reflect "reflect"
13
- sync "sync"
14
- )
15
-
16
- const (
17
- // Verify that this generated code is sufficiently up-to-date.
18
- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
19
- // Verify that runtime/protoimpl is sufficiently up-to-date.
20
- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
21
- )
22
-
23
- type ServerReport struct {
24
- state protoimpl.MessageState
25
- sizeCache protoimpl.SizeCache
26
- unknownFields protoimpl.UnknownFields
27
-
28
- Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
29
- Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
30
- Ips []string `protobuf:"bytes,3,rep,name=ips,proto3" json:"ips,omitempty"`
31
- NowDatetime string `protobuf:"bytes,4,opt,name=now_datetime,json=nowDatetime,proto3" json:"now_datetime,omitempty"`
32
- AuxData string `protobuf:"bytes,5,opt,name=aux_data,json=auxData,proto3" json:"aux_data,omitempty"` // other Incubator or Aux data
33
- }
34
-
35
- func (x *ServerReport) Reset() {
36
- *x = ServerReport{}
37
- if protoimpl.UnsafeEnabled {
38
- mi := &file_mao_server_discovery_proto_msgTypes[0]
39
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
40
- ms.StoreMessageInfo(mi)
41
- }
42
- }
43
-
44
- func (x *ServerReport) String() string {
45
- return protoimpl.X.MessageStringOf(x)
46
- }
47
-
48
- func (*ServerReport) ProtoMessage() {}
49
-
50
- func (x *ServerReport) ProtoReflect() protoreflect.Message {
51
- mi := &file_mao_server_discovery_proto_msgTypes[0]
52
- if protoimpl.UnsafeEnabled && x != nil {
53
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
54
- if ms.LoadMessageInfo() == nil {
55
- ms.StoreMessageInfo(mi)
56
- }
57
- return ms
58
- }
59
- return mi.MessageOf(x)
60
- }
61
-
62
- // Deprecated: Use ServerReport.ProtoReflect.Descriptor instead.
63
- func (*ServerReport) Descriptor() ([]byte, []int) {
64
- return file_mao_server_discovery_proto_rawDescGZIP(), []int{0}
65
- }
66
-
67
- func (x *ServerReport) GetOk() bool {
68
- if x != nil {
69
- return x.Ok
70
- }
71
- return false
72
- }
73
-
74
- func (x *ServerReport) GetHostname() string {
75
- if x != nil {
76
- return x.Hostname
77
- }
78
- return ""
79
- }
80
-
81
- func (x *ServerReport) GetIps() []string {
82
- if x != nil {
83
- return x.Ips
84
- }
85
- return nil
86
- }
87
-
88
- func (x *ServerReport) GetNowDatetime() string {
89
- if x != nil {
90
- return x.NowDatetime
91
- }
92
- return ""
93
- }
94
-
95
- func (x *ServerReport) GetAuxData() string {
96
- if x != nil {
97
- return x.AuxData
98
- }
99
- return ""
100
- }
101
-
102
- type ServerResponse struct {
103
- state protoimpl.MessageState
104
- sizeCache protoimpl.SizeCache
105
- unknownFields protoimpl.UnknownFields
106
-
107
- Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
108
- NewAddress string `protobuf:"bytes,2,opt,name=new_address,json=newAddress,proto3" json:"new_address,omitempty"`
109
- }
110
-
111
- func (x *ServerResponse) Reset() {
112
- *x = ServerResponse{}
113
- if protoimpl.UnsafeEnabled {
114
- mi := &file_mao_server_discovery_proto_msgTypes[1]
115
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
116
- ms.StoreMessageInfo(mi)
117
- }
118
- }
119
-
120
- func (x *ServerResponse) String() string {
121
- return protoimpl.X.MessageStringOf(x)
122
- }
123
-
124
- func (*ServerResponse) ProtoMessage() {}
125
-
126
- func (x *ServerResponse) ProtoReflect() protoreflect.Message {
127
- mi := &file_mao_server_discovery_proto_msgTypes[1]
128
- if protoimpl.UnsafeEnabled && x != nil {
129
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
130
- if ms.LoadMessageInfo() == nil {
131
- ms.StoreMessageInfo(mi)
132
- }
133
- return ms
134
- }
135
- return mi.MessageOf(x)
136
- }
137
-
138
- // Deprecated: Use ServerResponse.ProtoReflect.Descriptor instead.
139
- func (*ServerResponse) Descriptor() ([]byte, []int) {
140
- return file_mao_server_discovery_proto_rawDescGZIP(), []int{1}
141
- }
142
-
143
- func (x *ServerResponse) GetHostname() string {
144
- if x != nil {
145
- return x.Hostname
146
- }
147
- return ""
148
- }
149
-
150
- func (x *ServerResponse) GetNewAddress() string {
151
- if x != nil {
152
- return x.NewAddress
153
- }
154
- return ""
155
- }
156
-
157
- type RttEchoRequest struct {
158
- state protoimpl.MessageState
159
- sizeCache protoimpl.SizeCache
160
- unknownFields protoimpl.UnknownFields
161
-
162
- Seq uint64 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
163
- }
164
-
165
- func (x *RttEchoRequest) Reset() {
166
- *x = RttEchoRequest{}
167
- if protoimpl.UnsafeEnabled {
168
- mi := &file_mao_server_discovery_proto_msgTypes[2]
169
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
170
- ms.StoreMessageInfo(mi)
171
- }
172
- }
173
-
174
- func (x *RttEchoRequest) String() string {
175
- return protoimpl.X.MessageStringOf(x)
176
- }
177
-
178
- func (*RttEchoRequest) ProtoMessage() {}
179
-
180
- func (x *RttEchoRequest) ProtoReflect() protoreflect.Message {
181
- mi := &file_mao_server_discovery_proto_msgTypes[2]
182
- if protoimpl.UnsafeEnabled && x != nil {
183
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
184
- if ms.LoadMessageInfo() == nil {
185
- ms.StoreMessageInfo(mi)
186
- }
187
- return ms
188
- }
189
- return mi.MessageOf(x)
190
- }
191
-
192
- // Deprecated: Use RttEchoRequest.ProtoReflect.Descriptor instead.
193
- func (*RttEchoRequest) Descriptor() ([]byte, []int) {
194
- return file_mao_server_discovery_proto_rawDescGZIP(), []int{2}
195
- }
196
-
197
- func (x *RttEchoRequest) GetSeq() uint64 {
198
- if x != nil {
199
- return x.Seq
200
- }
201
- return 0
202
- }
203
-
204
- type RttEchoResponse struct {
205
- state protoimpl.MessageState
206
- sizeCache protoimpl.SizeCache
207
- unknownFields protoimpl.UnknownFields
208
-
209
- Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
210
- Ack uint64 `protobuf:"varint,2,opt,name=ack,proto3" json:"ack,omitempty"`
211
- }
212
-
213
- func (x *RttEchoResponse) Reset() {
214
- *x = RttEchoResponse{}
215
- if protoimpl.UnsafeEnabled {
216
- mi := &file_mao_server_discovery_proto_msgTypes[3]
217
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
218
- ms.StoreMessageInfo(mi)
219
- }
220
- }
221
-
222
- func (x *RttEchoResponse) String() string {
223
- return protoimpl.X.MessageStringOf(x)
224
- }
225
-
226
- func (*RttEchoResponse) ProtoMessage() {}
227
-
228
- func (x *RttEchoResponse) ProtoReflect() protoreflect.Message {
229
- mi := &file_mao_server_discovery_proto_msgTypes[3]
230
- if protoimpl.UnsafeEnabled && x != nil {
231
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
232
- if ms.LoadMessageInfo() == nil {
233
- ms.StoreMessageInfo(mi)
234
- }
235
- return ms
236
- }
237
- return mi.MessageOf(x)
238
- }
239
-
240
- // Deprecated: Use RttEchoResponse.ProtoReflect.Descriptor instead.
241
- func (*RttEchoResponse) Descriptor() ([]byte, []int) {
242
- return file_mao_server_discovery_proto_rawDescGZIP(), []int{3}
243
- }
244
-
245
- func (x *RttEchoResponse) GetHostname() string {
246
- if x != nil {
247
- return x.Hostname
248
- }
249
- return ""
250
- }
251
-
252
- func (x *RttEchoResponse) GetAck() uint64 {
253
- if x != nil {
254
- return x.Ack
255
- }
256
- return 0
257
- }
258
-
259
- var File_mao_server_discovery_proto protoreflect.FileDescriptor
260
-
261
- var file_mao_server_discovery_proto_rawDesc = []byte{
262
- 0x0a, 0x1a, 0x6d, 0x61, 0x6f, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x64, 0x69, 0x73,
263
- 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x4d, 0x61,
264
- 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f,
265
- 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02,
266
- 0x6f, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
267
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10,
268
- 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 0x73,
269
- 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65,
270
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x6f, 0x77, 0x44, 0x61, 0x74, 0x65, 0x74,
271
- 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x78, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18,
272
- 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x78, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4d,
273
- 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
274
- 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
275
- 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
276
- 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
277
- 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x22, 0x0a,
278
- 0x0e, 0x52, 0x74, 0x74, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
279
- 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65,
280
- 0x71, 0x22, 0x3f, 0x0a, 0x0f, 0x52, 0x74, 0x74, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73, 0x70,
281
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
282
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
283
- 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61,
284
- 0x63, 0x6b, 0x32, 0x8b, 0x01, 0x0a, 0x12, 0x4d, 0x61, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
285
- 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x36, 0x0a, 0x06, 0x52, 0x65, 0x70,
286
- 0x6f, 0x72, 0x74, 0x12, 0x11, 0x2e, 0x4d, 0x61, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
287
- 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x13, 0x2e, 0x4d, 0x61, 0x6f, 0x2e, 0x53, 0x65, 0x72,
288
- 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30,
289
- 0x01, 0x12, 0x3d, 0x0a, 0x0a, 0x52, 0x74, 0x74, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x12,
290
- 0x14, 0x2e, 0x4d, 0x61, 0x6f, 0x2e, 0x52, 0x74, 0x74, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x73,
291
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x13, 0x2e, 0x4d, 0x61, 0x6f, 0x2e, 0x52, 0x74, 0x74, 0x45,
292
- 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01,
293
- 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x6d, 0x61, 0x6f, 0x6a, 0x69, 0x61, 0x6e,
294
- 0x77, 0x65, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64,
295
- 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72,
296
- 0x6f, 0x74, 0x6f, 0x33,
297
- }
298
-
299
- var (
300
- file_mao_server_discovery_proto_rawDescOnce sync.Once
301
- file_mao_server_discovery_proto_rawDescData = file_mao_server_discovery_proto_rawDesc
302
- )
303
-
304
- func file_mao_server_discovery_proto_rawDescGZIP() []byte {
305
- file_mao_server_discovery_proto_rawDescOnce.Do(func() {
306
- file_mao_server_discovery_proto_rawDescData = protoimpl.X.CompressGZIP(file_mao_server_discovery_proto_rawDescData)
307
- })
308
- return file_mao_server_discovery_proto_rawDescData
309
- }
310
-
311
- var file_mao_server_discovery_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
312
- var file_mao_server_discovery_proto_goTypes = []interface{}{
313
- (*ServerReport)(nil), // 0: Mao.ServerReport
314
- (*ServerResponse)(nil), // 1: Mao.ServerResponse
315
- (*RttEchoRequest)(nil), // 2: Mao.RttEchoRequest
316
- (*RttEchoResponse)(nil), // 3: Mao.RttEchoResponse
317
- }
318
- var file_mao_server_discovery_proto_depIdxs = []int32{
319
- 0, // 0: Mao.MaoServerDiscovery.Report:input_type -> Mao.ServerReport
320
- 3, // 1: Mao.MaoServerDiscovery.RttMeasure:input_type -> Mao.RttEchoResponse
321
- 1, // 2: Mao.MaoServerDiscovery.Report:output_type -> Mao.ServerResponse
322
- 2, // 3: Mao.MaoServerDiscovery.RttMeasure:output_type -> Mao.RttEchoRequest
323
- 2, // [2:4] is the sub-list for method output_type
324
- 0, // [0:2] is the sub-list for method input_type
325
- 0, // [0:0] is the sub-list for extension type_name
326
- 0, // [0:0] is the sub-list for extension extendee
327
- 0, // [0:0] is the sub-list for field type_name
328
- }
329
-
330
- func init() { file_mao_server_discovery_proto_init() }
331
- func file_mao_server_discovery_proto_init() {
332
- if File_mao_server_discovery_proto != nil {
333
- return
334
- }
335
- if !protoimpl.UnsafeEnabled {
336
- file_mao_server_discovery_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
337
- switch v := v.(*ServerReport); i {
338
- case 0:
339
- return &v.state
340
- case 1:
341
- return &v.sizeCache
342
- case 2:
343
- return &v.unknownFields
344
- default:
345
- return nil
346
- }
347
- }
348
- file_mao_server_discovery_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
349
- switch v := v.(*ServerResponse); i {
350
- case 0:
351
- return &v.state
352
- case 1:
353
- return &v.sizeCache
354
- case 2:
355
- return &v.unknownFields
356
- default:
357
- return nil
358
- }
359
- }
360
- file_mao_server_discovery_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
361
- switch v := v.(*RttEchoRequest); i {
362
- case 0:
363
- return &v.state
364
- case 1:
365
- return &v.sizeCache
366
- case 2:
367
- return &v.unknownFields
368
- default:
369
- return nil
370
- }
371
- }
372
- file_mao_server_discovery_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
373
- switch v := v.(*RttEchoResponse); i {
374
- case 0:
375
- return &v.state
376
- case 1:
377
- return &v.sizeCache
378
- case 2:
379
- return &v.unknownFields
380
- default:
381
- return nil
382
- }
383
- }
384
- }
385
- type x struct{}
386
- out := protoimpl.TypeBuilder{
387
- File: protoimpl.DescBuilder{
388
- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
389
- RawDescriptor: file_mao_server_discovery_proto_rawDesc,
390
- NumEnums: 0,
391
- NumMessages: 4,
392
- NumExtensions: 0,
393
- NumServices: 1,
394
- },
395
- GoTypes: file_mao_server_discovery_proto_goTypes,
396
- DependencyIndexes: file_mao_server_discovery_proto_depIdxs,
397
- MessageInfos: file_mao_server_discovery_proto_msgTypes,
398
- }.Build()
399
- File_mao_server_discovery_proto = out.File
400
- file_mao_server_discovery_proto_rawDesc = nil
401
- file_mao_server_discovery_proto_goTypes = nil
402
- file_mao_server_discovery_proto_depIdxs = nil
403
- }
@@ -1,35 +0,0 @@
1
-
2
- syntax = "proto3";
3
-
4
- option go_package = "grpc.maojianwei.com/server/discovery/api";
5
-
6
- package Mao;
7
-
8
- service MaoServerDiscovery {
9
- rpc Report(stream ServerReport) returns (stream ServerResponse) {}
10
-
11
- // server initiate the measure request
12
- rpc RttMeasure(stream RttEchoResponse) returns (stream RttEchoRequest) {}
13
- }
14
-
15
- message ServerReport {
16
- bool ok = 1;
17
- string hostname = 2;
18
- repeated string ips = 3;
19
- string now_datetime = 4;
20
- string aux_data = 5; // other Incubator or Aux data
21
- }
22
-
23
- message ServerResponse {
24
- string hostname = 1;
25
- string new_address = 2;
26
- }
27
-
28
- message RttEchoRequest {
29
- uint64 seq = 1;
30
- }
31
-
32
- message RttEchoResponse {
33
- string hostname = 1;
34
- uint64 ack = 2;
35
- }
@@ -1,207 +0,0 @@
1
- // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
- // versions:
3
- // - protoc-gen-go-grpc v1.1.0
4
- // - protoc v3.17.0
5
- // source: mao-server-discovery.proto
6
-
7
- package api
8
-
9
- import (
10
- context "context"
11
- grpc "google.golang.org/grpc"
12
- codes "google.golang.org/grpc/codes"
13
- status "google.golang.org/grpc/status"
14
- )
15
-
16
- // This is a compile-time assertion to ensure that this generated file
17
- // is compatible with the grpc package it is being compiled against.
18
- // Requires gRPC-Go v1.32.0 or later.
19
- const _ = grpc.SupportPackageIsVersion7
20
-
21
- // MaoServerDiscoveryClient is the client API for MaoServerDiscovery service.
22
- //
23
- // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
24
- type MaoServerDiscoveryClient interface {
25
- Report(ctx context.Context, opts ...grpc.CallOption) (MaoServerDiscovery_ReportClient, error)
26
- // server initiate the measure request
27
- RttMeasure(ctx context.Context, opts ...grpc.CallOption) (MaoServerDiscovery_RttMeasureClient, error)
28
- }
29
-
30
- type maoServerDiscoveryClient struct {
31
- cc grpc.ClientConnInterface
32
- }
33
-
34
- func NewMaoServerDiscoveryClient(cc grpc.ClientConnInterface) MaoServerDiscoveryClient {
35
- return &maoServerDiscoveryClient{cc}
36
- }
37
-
38
- func (c *maoServerDiscoveryClient) Report(ctx context.Context, opts ...grpc.CallOption) (MaoServerDiscovery_ReportClient, error) {
39
- stream, err := c.cc.NewStream(ctx, &MaoServerDiscovery_ServiceDesc.Streams[0], "/Mao.MaoServerDiscovery/Report", opts...)
40
- if err != nil {
41
- return nil, err
42
- }
43
- x := &maoServerDiscoveryReportClient{stream}
44
- return x, nil
45
- }
46
-
47
- type MaoServerDiscovery_ReportClient interface {
48
- Send(*ServerReport) error
49
- Recv() (*ServerResponse, error)
50
- grpc.ClientStream
51
- }
52
-
53
- type maoServerDiscoveryReportClient struct {
54
- grpc.ClientStream
55
- }
56
-
57
- func (x *maoServerDiscoveryReportClient) Send(m *ServerReport) error {
58
- return x.ClientStream.SendMsg(m)
59
- }
60
-
61
- func (x *maoServerDiscoveryReportClient) Recv() (*ServerResponse, error) {
62
- m := new(ServerResponse)
63
- if err := x.ClientStream.RecvMsg(m); err != nil {
64
- return nil, err
65
- }
66
- return m, nil
67
- }
68
-
69
- func (c *maoServerDiscoveryClient) RttMeasure(ctx context.Context, opts ...grpc.CallOption) (MaoServerDiscovery_RttMeasureClient, error) {
70
- stream, err := c.cc.NewStream(ctx, &MaoServerDiscovery_ServiceDesc.Streams[1], "/Mao.MaoServerDiscovery/RttMeasure", opts...)
71
- if err != nil {
72
- return nil, err
73
- }
74
- x := &maoServerDiscoveryRttMeasureClient{stream}
75
- return x, nil
76
- }
77
-
78
- type MaoServerDiscovery_RttMeasureClient interface {
79
- Send(*RttEchoResponse) error
80
- Recv() (*RttEchoRequest, error)
81
- grpc.ClientStream
82
- }
83
-
84
- type maoServerDiscoveryRttMeasureClient struct {
85
- grpc.ClientStream
86
- }
87
-
88
- func (x *maoServerDiscoveryRttMeasureClient) Send(m *RttEchoResponse) error {
89
- return x.ClientStream.SendMsg(m)
90
- }
91
-
92
- func (x *maoServerDiscoveryRttMeasureClient) Recv() (*RttEchoRequest, error) {
93
- m := new(RttEchoRequest)
94
- if err := x.ClientStream.RecvMsg(m); err != nil {
95
- return nil, err
96
- }
97
- return m, nil
98
- }
99
-
100
- // MaoServerDiscoveryServer is the server API for MaoServerDiscovery service.
101
- // All implementations must embed UnimplementedMaoServerDiscoveryServer
102
- // for forward compatibility
103
- type MaoServerDiscoveryServer interface {
104
- Report(MaoServerDiscovery_ReportServer) error
105
- // server initiate the measure request
106
- RttMeasure(MaoServerDiscovery_RttMeasureServer) error
107
- mustEmbedUnimplementedMaoServerDiscoveryServer()
108
- }
109
-
110
- // UnimplementedMaoServerDiscoveryServer must be embedded to have forward compatible implementations.
111
- type UnimplementedMaoServerDiscoveryServer struct {
112
- }
113
-
114
- func (UnimplementedMaoServerDiscoveryServer) Report(MaoServerDiscovery_ReportServer) error {
115
- return status.Errorf(codes.Unimplemented, "method Report not implemented")
116
- }
117
- func (UnimplementedMaoServerDiscoveryServer) RttMeasure(MaoServerDiscovery_RttMeasureServer) error {
118
- return status.Errorf(codes.Unimplemented, "method RttMeasure not implemented")
119
- }
120
- func (UnimplementedMaoServerDiscoveryServer) mustEmbedUnimplementedMaoServerDiscoveryServer() {}
121
-
122
- // UnsafeMaoServerDiscoveryServer may be embedded to opt out of forward compatibility for this service.
123
- // Use of this interface is not recommended, as added methods to MaoServerDiscoveryServer will
124
- // result in compilation errors.
125
- type UnsafeMaoServerDiscoveryServer interface {
126
- mustEmbedUnimplementedMaoServerDiscoveryServer()
127
- }
128
-
129
- func RegisterMaoServerDiscoveryServer(s grpc.ServiceRegistrar, srv MaoServerDiscoveryServer) {
130
- s.RegisterService(&MaoServerDiscovery_ServiceDesc, srv)
131
- }
132
-
133
- func _MaoServerDiscovery_Report_Handler(srv interface{}, stream grpc.ServerStream) error {
134
- return srv.(MaoServerDiscoveryServer).Report(&maoServerDiscoveryReportServer{stream})
135
- }
136
-
137
- type MaoServerDiscovery_ReportServer interface {
138
- Send(*ServerResponse) error
139
- Recv() (*ServerReport, error)
140
- grpc.ServerStream
141
- }
142
-
143
- type maoServerDiscoveryReportServer struct {
144
- grpc.ServerStream
145
- }
146
-
147
- func (x *maoServerDiscoveryReportServer) Send(m *ServerResponse) error {
148
- return x.ServerStream.SendMsg(m)
149
- }
150
-
151
- func (x *maoServerDiscoveryReportServer) Recv() (*ServerReport, error) {
152
- m := new(ServerReport)
153
- if err := x.ServerStream.RecvMsg(m); err != nil {
154
- return nil, err
155
- }
156
- return m, nil
157
- }
158
-
159
- func _MaoServerDiscovery_RttMeasure_Handler(srv interface{}, stream grpc.ServerStream) error {
160
- return srv.(MaoServerDiscoveryServer).RttMeasure(&maoServerDiscoveryRttMeasureServer{stream})
161
- }
162
-
163
- type MaoServerDiscovery_RttMeasureServer interface {
164
- Send(*RttEchoRequest) error
165
- Recv() (*RttEchoResponse, error)
166
- grpc.ServerStream
167
- }
168
-
169
- type maoServerDiscoveryRttMeasureServer struct {
170
- grpc.ServerStream
171
- }
172
-
173
- func (x *maoServerDiscoveryRttMeasureServer) Send(m *RttEchoRequest) error {
174
- return x.ServerStream.SendMsg(m)
175
- }
176
-
177
- func (x *maoServerDiscoveryRttMeasureServer) Recv() (*RttEchoResponse, error) {
178
- m := new(RttEchoResponse)
179
- if err := x.ServerStream.RecvMsg(m); err != nil {
180
- return nil, err
181
- }
182
- return m, nil
183
- }
184
-
185
- // MaoServerDiscovery_ServiceDesc is the grpc.ServiceDesc for MaoServerDiscovery service.
186
- // It's only intended for direct use with grpc.RegisterService,
187
- // and not to be introspected or modified (even as a copy)
188
- var MaoServerDiscovery_ServiceDesc = grpc.ServiceDesc{
189
- ServiceName: "Mao.MaoServerDiscovery",
190
- HandlerType: (*MaoServerDiscoveryServer)(nil),
191
- Methods: []grpc.MethodDesc{},
192
- Streams: []grpc.StreamDesc{
193
- {
194
- StreamName: "Report",
195
- Handler: _MaoServerDiscovery_Report_Handler,
196
- ServerStreams: true,
197
- ClientStreams: true,
198
- },
199
- {
200
- StreamName: "RttMeasure",
201
- Handler: _MaoServerDiscovery_RttMeasure_Handler,
202
- ServerStreams: true,
203
- ClientStreams: true,
204
- },
205
- },
206
- Metadata: "mao-server-discovery.proto",
207
- }