智能DNS支持自定义端口

This commit is contained in:
刘祥超
2022-07-27 16:56:32 +08:00
parent f6b3a0b829
commit 262dcf0c8d
9 changed files with 4285 additions and 3187 deletions

View File

@@ -35,6 +35,9 @@ type NSCluster struct {
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"`
TcpJSON []byte `protobuf:"bytes,5,opt,name=tcpJSON,proto3" json:"tcpJSON,omitempty"`
TlsJSON []byte `protobuf:"bytes,6,opt,name=tlsJSON,proto3" json:"tlsJSON,omitempty"`
UdpJSON []byte `protobuf:"bytes,7,opt,name=udpJSON,proto3" json:"udpJSON,omitempty"`
}
func (x *NSCluster) Reset() {
@@ -97,19 +100,45 @@ func (x *NSCluster) GetInstallDir() string {
return ""
}
func (x *NSCluster) GetTcpJSON() []byte {
if x != nil {
return x.TcpJSON
}
return nil
}
func (x *NSCluster) GetTlsJSON() []byte {
if x != nil {
return x.TlsJSON
}
return nil
}
func (x *NSCluster) GetUdpJSON() []byte {
if x != nil {
return x.UdpJSON
}
return nil
}
var File_models_model_ns_cluster_proto protoreflect.FileDescriptor
var file_models_model_ns_cluster_proto_rawDesc = []byte{
0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x02, 0x70, 0x62, 0x22, 0x63, 0x0a, 0x09, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04,
0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74,
0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e,
0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x02, 0x70, 0x62, 0x22, 0xb1, 0x01, 0x0a, 0x09, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73,
0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69,
0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x63, 0x70,
0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x63, 0x70, 0x4a,
0x53, 0x4f, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x6c, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x6c, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x18, 0x0a,
0x07, 0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

File diff suppressed because it is too large Load Diff

View File

@@ -9,4 +9,7 @@ message NSCluster {
bool isOn = 2;
string name = 3;
string installDir = 4;
bytes tcpJSON = 5;
bytes tlsJSON = 6;
bytes udpJSON = 7;
}

View File

@@ -40,6 +40,24 @@ service NSClusterService {
// 读取递归DNS配置
rpc findNSClusterRecursionConfig(FindNSClusterRecursionConfigRequest) returns (FindNSClusterRecursionConfigResponse);
// 查找集群的TCP设置
rpc findNSClusterTCPConfig(FindNSClusterTCPConfigRequest) returns (FindNSClusterTCPConfigResponse);
// 修改集群的TCP设置
rpc updateNSClusterTCP (UpdateNSClusterTCPRequest) returns (RPCSuccess);
// 查找集群的TLS设置
rpc findNSClusterTLSConfig(FindNSClusterTLSConfigRequest) returns (FindNSClusterTLSConfigResponse);
// 修改集群的TLS设置
rpc updateNSClusterTLS (UpdateNSClusterTLSRequest) returns (RPCSuccess);
// 查找集群的UDP设置
rpc findNSClusterUDPConfig(FindNSClusterUDPConfigRequest) returns (FindNSClusterUDPConfigResponse);
// 修改集群的UDP设置
rpc updateNSClusterUDP (UpdateNSClusterUDPRequest) returns (RPCSuccess);
}
// 创建集群
@@ -124,4 +142,49 @@ message FindNSClusterRecursionConfigRequest {
message FindNSClusterRecursionConfigResponse {
bytes recursionJSON = 1;
}
// 查找集群的TCP设置
message FindNSClusterTCPConfigRequest {
int64 nsClusterId = 1;
}
message FindNSClusterTCPConfigResponse {
bytes tcpJSON = 1;
}
// 查找集群的TLS设置
message FindNSClusterTLSConfigRequest {
int64 nsClusterId = 1;
}
message FindNSClusterTLSConfigResponse {
bytes tlsJSON = 1;
}
// 查找集群的UDP设置
message FindNSClusterUDPConfigRequest {
int64 nsClusterId = 1;
}
message FindNSClusterUDPConfigResponse {
bytes udpJSON = 1;
}
// 修改集群的TCP设置
message UpdateNSClusterTCPRequest {
int64 nsClusterId = 1;
bytes tcpJSON = 2;
}
// 修改集群的TLS设置
message UpdateNSClusterTLSRequest {
int64 nsClusterId = 1;
bytes tlsJSON = 2;
}
// 修改集群的UDP设置
message UpdateNSClusterUDPRequest {
int64 nsClusterId = 1;
bytes udpJSON = 2;
}