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

This commit is contained in:
GoEdgeLab
2020-11-13 18:23:06 +08:00
parent 37538b40a9
commit 7ed42cb3da
74 changed files with 3533 additions and 2115 deletions

View File

@@ -498,42 +498,41 @@ var file_service_server_group_proto_rawDesc = []byte{
0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x9b, 0x04, 0x0a, 0x12,
0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x89, 0x04, 0x0a, 0x12,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,
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, 0x47, 0x0a,
0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x1a, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c,
0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c,
0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53,
0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x22,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 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, 0x5f, 0x0a, 0x16, 0x66, 0x69, 0x6e, 0x64,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62,
0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,
0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x2e, 0x70,
0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x1a, 0x66, 0x69,
0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69,
0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76,
0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x26, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62,
0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65,
0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x5f, 0x0a, 0x16, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -560,8 +559,7 @@ var file_service_server_group_proto_goTypes = []interface{}{
(*FindEnabledServerGroupRequest)(nil), // 7: pb.FindEnabledServerGroupRequest
(*FindEnabledServerGroupResponse)(nil), // 8: pb.FindEnabledServerGroupResponse
(*ServerGroup)(nil), // 9: pb.ServerGroup
(*RPCUpdateSuccess)(nil), // 10: pb.RPCUpdateSuccess
(*RPCDeleteSuccess)(nil), // 11: pb.RPCDeleteSuccess
(*RPCSuccess)(nil), // 10: pb.RPCSuccess
}
var file_service_server_group_proto_depIdxs = []int32{
9, // 0: pb.FindAllEnabledServerGroupsResponse.groups:type_name -> pb.ServerGroup
@@ -573,10 +571,10 @@ var file_service_server_group_proto_depIdxs = []int32{
6, // 6: pb.ServerGroupService.updateServerGroupOrders:input_type -> pb.UpdateServerGroupOrdersRequest
7, // 7: pb.ServerGroupService.findEnabledServerGroup:input_type -> pb.FindEnabledServerGroupRequest
1, // 8: pb.ServerGroupService.createServerGroup:output_type -> pb.CreateServerGroupResponse
10, // 9: pb.ServerGroupService.updateServerGroup:output_type -> pb.RPCUpdateSuccess
11, // 10: pb.ServerGroupService.deleteServerGroup:output_type -> pb.RPCDeleteSuccess
10, // 9: pb.ServerGroupService.updateServerGroup:output_type -> pb.RPCSuccess
10, // 10: pb.ServerGroupService.deleteServerGroup:output_type -> pb.RPCSuccess
5, // 11: pb.ServerGroupService.findAllEnabledServerGroups:output_type -> pb.FindAllEnabledServerGroupsResponse
10, // 12: pb.ServerGroupService.updateServerGroupOrders:output_type -> pb.RPCUpdateSuccess
10, // 12: pb.ServerGroupService.updateServerGroupOrders:output_type -> pb.RPCSuccess
8, // 13: pb.ServerGroupService.findEnabledServerGroup:output_type -> pb.FindEnabledServerGroupResponse
8, // [8:14] is the sub-list for method output_type
2, // [2:8] is the sub-list for method input_type
@@ -737,13 +735,13 @@ type ServerGroupServiceClient interface {
// 创建分组
CreateServerGroup(ctx context.Context, in *CreateServerGroupRequest, opts ...grpc.CallOption) (*CreateServerGroupResponse, error)
// 修改分组
UpdateServerGroup(ctx context.Context, in *UpdateServerGroupRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateServerGroup(ctx context.Context, in *UpdateServerGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 删除分组
DeleteServerGroup(ctx context.Context, in *DeleteServerGroupRequest, opts ...grpc.CallOption) (*RPCDeleteSuccess, error)
DeleteServerGroup(ctx context.Context, in *DeleteServerGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查询所有分组
FindAllEnabledServerGroups(ctx context.Context, in *FindAllEnabledServerGroupsRequest, opts ...grpc.CallOption) (*FindAllEnabledServerGroupsResponse, error)
// 修改分组排序
UpdateServerGroupOrders(ctx context.Context, in *UpdateServerGroupOrdersRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateServerGroupOrders(ctx context.Context, in *UpdateServerGroupOrdersRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查找单个分组信息
FindEnabledServerGroup(ctx context.Context, in *FindEnabledServerGroupRequest, opts ...grpc.CallOption) (*FindEnabledServerGroupResponse, error)
}
@@ -765,8 +763,8 @@ func (c *serverGroupServiceClient) CreateServerGroup(ctx context.Context, in *Cr
return out, nil
}
func (c *serverGroupServiceClient) UpdateServerGroup(ctx context.Context, in *UpdateServerGroupRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *serverGroupServiceClient) UpdateServerGroup(ctx context.Context, in *UpdateServerGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.ServerGroupService/updateServerGroup", in, out, opts...)
if err != nil {
return nil, err
@@ -774,8 +772,8 @@ func (c *serverGroupServiceClient) UpdateServerGroup(ctx context.Context, in *Up
return out, nil
}
func (c *serverGroupServiceClient) DeleteServerGroup(ctx context.Context, in *DeleteServerGroupRequest, opts ...grpc.CallOption) (*RPCDeleteSuccess, error) {
out := new(RPCDeleteSuccess)
func (c *serverGroupServiceClient) DeleteServerGroup(ctx context.Context, in *DeleteServerGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.ServerGroupService/deleteServerGroup", in, out, opts...)
if err != nil {
return nil, err
@@ -792,8 +790,8 @@ func (c *serverGroupServiceClient) FindAllEnabledServerGroups(ctx context.Contex
return out, nil
}
func (c *serverGroupServiceClient) UpdateServerGroupOrders(ctx context.Context, in *UpdateServerGroupOrdersRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *serverGroupServiceClient) UpdateServerGroupOrders(ctx context.Context, in *UpdateServerGroupOrdersRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.ServerGroupService/updateServerGroupOrders", in, out, opts...)
if err != nil {
return nil, err
@@ -815,13 +813,13 @@ type ServerGroupServiceServer interface {
// 创建分组
CreateServerGroup(context.Context, *CreateServerGroupRequest) (*CreateServerGroupResponse, error)
// 修改分组
UpdateServerGroup(context.Context, *UpdateServerGroupRequest) (*RPCUpdateSuccess, error)
UpdateServerGroup(context.Context, *UpdateServerGroupRequest) (*RPCSuccess, error)
// 删除分组
DeleteServerGroup(context.Context, *DeleteServerGroupRequest) (*RPCDeleteSuccess, error)
DeleteServerGroup(context.Context, *DeleteServerGroupRequest) (*RPCSuccess, error)
// 查询所有分组
FindAllEnabledServerGroups(context.Context, *FindAllEnabledServerGroupsRequest) (*FindAllEnabledServerGroupsResponse, error)
// 修改分组排序
UpdateServerGroupOrders(context.Context, *UpdateServerGroupOrdersRequest) (*RPCUpdateSuccess, error)
UpdateServerGroupOrders(context.Context, *UpdateServerGroupOrdersRequest) (*RPCSuccess, error)
// 查找单个分组信息
FindEnabledServerGroup(context.Context, *FindEnabledServerGroupRequest) (*FindEnabledServerGroupResponse, error)
}
@@ -833,16 +831,16 @@ type UnimplementedServerGroupServiceServer struct {
func (*UnimplementedServerGroupServiceServer) CreateServerGroup(context.Context, *CreateServerGroupRequest) (*CreateServerGroupResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateServerGroup not implemented")
}
func (*UnimplementedServerGroupServiceServer) UpdateServerGroup(context.Context, *UpdateServerGroupRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedServerGroupServiceServer) UpdateServerGroup(context.Context, *UpdateServerGroupRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateServerGroup not implemented")
}
func (*UnimplementedServerGroupServiceServer) DeleteServerGroup(context.Context, *DeleteServerGroupRequest) (*RPCDeleteSuccess, error) {
func (*UnimplementedServerGroupServiceServer) DeleteServerGroup(context.Context, *DeleteServerGroupRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteServerGroup not implemented")
}
func (*UnimplementedServerGroupServiceServer) FindAllEnabledServerGroups(context.Context, *FindAllEnabledServerGroupsRequest) (*FindAllEnabledServerGroupsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledServerGroups not implemented")
}
func (*UnimplementedServerGroupServiceServer) UpdateServerGroupOrders(context.Context, *UpdateServerGroupOrdersRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedServerGroupServiceServer) UpdateServerGroupOrders(context.Context, *UpdateServerGroupOrdersRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateServerGroupOrders not implemented")
}
func (*UnimplementedServerGroupServiceServer) FindEnabledServerGroup(context.Context, *FindEnabledServerGroupRequest) (*FindEnabledServerGroupResponse, error) {