域名解析功能实现健康检查

This commit is contained in:
GoEdgeLab
2023-05-03 17:09:36 +08:00
parent 276f492152
commit f52a55e670
9 changed files with 1298 additions and 375 deletions

View File

@@ -31,19 +31,20 @@ type NSDomain struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Version int64 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"`
TsigJSON []byte `protobuf:"bytes,7,opt,name=tsigJSON,proto3" json:"tsigJSON,omitempty"`
NsDomainGroupIds []int64 `protobuf:"varint,8,rep,packed,name=nsDomainGroupIds,proto3" json:"nsDomainGroupIds,omitempty"`
Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
UserId int64 `protobuf:"varint,10,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"`
NsDomainGroups []*NSDomainGroup `protobuf:"bytes,32,rep,name=nsDomainGroups,proto3" json:"nsDomainGroups,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Version int64 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"`
TsigJSON []byte `protobuf:"bytes,7,opt,name=tsigJSON,proto3" json:"tsigJSON,omitempty"`
NsDomainGroupIds []int64 `protobuf:"varint,8,rep,packed,name=nsDomainGroupIds,proto3" json:"nsDomainGroupIds,omitempty"`
Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
UserId int64 `protobuf:"varint,10,opt,name=userId,proto3" json:"userId,omitempty"` // 用户ID
RecordsHealthCheckJSON []byte `protobuf:"bytes,11,opt,name=recordsHealthCheckJSON,proto3" json:"recordsHealthCheckJSON,omitempty"` // 健康检查设置
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
User *User `protobuf:"bytes,31,opt,name=user,proto3" json:"user,omitempty"`
NsDomainGroups []*NSDomainGroup `protobuf:"bytes,32,rep,name=nsDomainGroups,proto3" json:"nsDomainGroups,omitempty"`
}
func (x *NSDomain) Reset() {
@@ -148,6 +149,13 @@ func (x *NSDomain) GetUserId() int64 {
return 0
}
func (x *NSDomain) GetRecordsHealthCheckJSON() []byte {
if x != nil {
return x.RecordsHealthCheckJSON
}
return nil
}
func (x *NSDomain) GetNsCluster() *NSCluster {
if x != nil {
return x.NsCluster
@@ -179,7 +187,7 @@ var file_models_model_ns_domain_proto_rawDesc = []byte{
0x6f, 0x1a, 0x22, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x6e, 0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f,
0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96,
0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce,
0x03, 0x0a, 0x08, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
@@ -197,16 +205,19 @@ var file_models_model_ns_domain_proto_rawDesc = []byte{
0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
0x64, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73,
0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c,
0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70,
0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x0e,
0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x20,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0e, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x64, 0x12, 0x36, 0x0a, 0x16, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x48, 0x65, 0x61, 0x6c,
0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x16, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x1f,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04,
0x75, 0x73, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x0e, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70,
0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,
0x0e, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (