实现基本的集群DNS列表、设置、简单数据同步

This commit is contained in:
刘祥超
2020-11-13 18:23:06 +08:00
parent 5820354c90
commit 3e4a50e564
74 changed files with 3533 additions and 2115 deletions

View File

@@ -352,7 +352,7 @@ var file_service_message_proto_rawDesc = []byte{
0x73, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x08, 0x52, 0x06, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65,
0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x97, 0x03, 0x0a, 0x0e, 0x4d, 0x65,
0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x85, 0x03, 0x0a, 0x0e, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x13,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x6e,
@@ -363,23 +363,22 @@ var file_service_message_proto_rawDesc = []byte{
0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e,
0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47,
0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41,
0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
0x65, 0x61, 0x64, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e,
0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x4f, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63,
0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x12, 0x43, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x41, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12,
0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@@ -404,7 +403,7 @@ var file_service_message_proto_goTypes = []interface{}{
(*UpdateAllMessagesReadRequest)(nil), // 5: pb.UpdateAllMessagesReadRequest
(*Message)(nil), // 6: pb.Message
(*RPCCountResponse)(nil), // 7: pb.RPCCountResponse
(*RPCUpdateSuccess)(nil), // 8: pb.RPCUpdateSuccess
(*RPCSuccess)(nil), // 8: pb.RPCSuccess
}
var file_service_message_proto_depIdxs = []int32{
6, // 0: pb.ListUnreadMessagesResponse.messages:type_name -> pb.Message
@@ -415,9 +414,9 @@ var file_service_message_proto_depIdxs = []int32{
5, // 5: pb.MessageService.updateAllMessagesRead:input_type -> pb.UpdateAllMessagesReadRequest
7, // 6: pb.MessageService.countUnreadMessages:output_type -> pb.RPCCountResponse
2, // 7: pb.MessageService.listUnreadMessages:output_type -> pb.ListUnreadMessagesResponse
8, // 8: pb.MessageService.updateMessageRead:output_type -> pb.RPCUpdateSuccess
8, // 9: pb.MessageService.updateMessagesRead:output_type -> pb.RPCUpdateSuccess
8, // 10: pb.MessageService.updateAllMessagesRead:output_type -> pb.RPCUpdateSuccess
8, // 8: pb.MessageService.updateMessageRead:output_type -> pb.RPCSuccess
8, // 9: pb.MessageService.updateMessagesRead:output_type -> pb.RPCSuccess
8, // 10: pb.MessageService.updateAllMessagesRead:output_type -> pb.RPCSuccess
6, // [6:11] is the sub-list for method output_type
1, // [1:6] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -543,11 +542,11 @@ type MessageServiceClient interface {
// 列出单页未读消息
ListUnreadMessages(ctx context.Context, in *ListUnreadMessagesRequest, opts ...grpc.CallOption) (*ListUnreadMessagesResponse, error)
// 设置消息已读状态
UpdateMessageRead(ctx context.Context, in *UpdateMessageReadRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateMessageRead(ctx context.Context, in *UpdateMessageReadRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 设置一组消息已读状态
UpdateMessagesRead(ctx context.Context, in *UpdateMessagesReadRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateMessagesRead(ctx context.Context, in *UpdateMessagesReadRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 设置所有消息为已读
UpdateAllMessagesRead(ctx context.Context, in *UpdateAllMessagesReadRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateAllMessagesRead(ctx context.Context, in *UpdateAllMessagesReadRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
}
type messageServiceClient struct {
@@ -576,8 +575,8 @@ func (c *messageServiceClient) ListUnreadMessages(ctx context.Context, in *ListU
return out, nil
}
func (c *messageServiceClient) UpdateMessageRead(ctx context.Context, in *UpdateMessageReadRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *messageServiceClient) UpdateMessageRead(ctx context.Context, in *UpdateMessageReadRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.MessageService/updateMessageRead", in, out, opts...)
if err != nil {
return nil, err
@@ -585,8 +584,8 @@ func (c *messageServiceClient) UpdateMessageRead(ctx context.Context, in *Update
return out, nil
}
func (c *messageServiceClient) UpdateMessagesRead(ctx context.Context, in *UpdateMessagesReadRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *messageServiceClient) UpdateMessagesRead(ctx context.Context, in *UpdateMessagesReadRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.MessageService/updateMessagesRead", in, out, opts...)
if err != nil {
return nil, err
@@ -594,8 +593,8 @@ func (c *messageServiceClient) UpdateMessagesRead(ctx context.Context, in *Updat
return out, nil
}
func (c *messageServiceClient) UpdateAllMessagesRead(ctx context.Context, in *UpdateAllMessagesReadRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *messageServiceClient) UpdateAllMessagesRead(ctx context.Context, in *UpdateAllMessagesReadRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.MessageService/updateAllMessagesRead", in, out, opts...)
if err != nil {
return nil, err
@@ -610,11 +609,11 @@ type MessageServiceServer interface {
// 列出单页未读消息
ListUnreadMessages(context.Context, *ListUnreadMessagesRequest) (*ListUnreadMessagesResponse, error)
// 设置消息已读状态
UpdateMessageRead(context.Context, *UpdateMessageReadRequest) (*RPCUpdateSuccess, error)
UpdateMessageRead(context.Context, *UpdateMessageReadRequest) (*RPCSuccess, error)
// 设置一组消息已读状态
UpdateMessagesRead(context.Context, *UpdateMessagesReadRequest) (*RPCUpdateSuccess, error)
UpdateMessagesRead(context.Context, *UpdateMessagesReadRequest) (*RPCSuccess, error)
// 设置所有消息为已读
UpdateAllMessagesRead(context.Context, *UpdateAllMessagesReadRequest) (*RPCUpdateSuccess, error)
UpdateAllMessagesRead(context.Context, *UpdateAllMessagesReadRequest) (*RPCSuccess, error)
}
// UnimplementedMessageServiceServer can be embedded to have forward compatible implementations.
@@ -627,13 +626,13 @@ func (*UnimplementedMessageServiceServer) CountUnreadMessages(context.Context, *
func (*UnimplementedMessageServiceServer) ListUnreadMessages(context.Context, *ListUnreadMessagesRequest) (*ListUnreadMessagesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListUnreadMessages not implemented")
}
func (*UnimplementedMessageServiceServer) UpdateMessageRead(context.Context, *UpdateMessageReadRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedMessageServiceServer) UpdateMessageRead(context.Context, *UpdateMessageReadRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateMessageRead not implemented")
}
func (*UnimplementedMessageServiceServer) UpdateMessagesRead(context.Context, *UpdateMessagesReadRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedMessageServiceServer) UpdateMessagesRead(context.Context, *UpdateMessagesReadRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateMessagesRead not implemented")
}
func (*UnimplementedMessageServiceServer) UpdateAllMessagesRead(context.Context, *UpdateAllMessagesReadRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedMessageServiceServer) UpdateAllMessagesRead(context.Context, *UpdateAllMessagesReadRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateAllMessagesRead not implemented")
}