1.4.5.2
This commit is contained in:
49
EdgeCommon/pkg/dnsconfigs/ns_user_config.go
Normal file
49
EdgeCommon/pkg/dnsconfigs/ns_user_config.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
//go:build plus
|
||||
|
||||
package dnsconfigs
|
||||
|
||||
// NSDomainValidationConfig 域名校验设置
|
||||
type NSDomainValidationConfig struct {
|
||||
IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用
|
||||
Resolvers []*DNSResolver `yaml:"resolvers" json:"resolvers"` // 域名解析地址
|
||||
}
|
||||
|
||||
func NewNSDomainValidationConfig() *NSDomainValidationConfig {
|
||||
return &NSDomainValidationConfig{
|
||||
IsOn: true,
|
||||
Resolvers: []*DNSResolver{},
|
||||
}
|
||||
}
|
||||
|
||||
func NewNSUserConfig() *NSUserConfig {
|
||||
return &NSUserConfig{
|
||||
DefaultClusterId: 0,
|
||||
DefaultPlanConfig: DefaultNSUserPlanConfig(),
|
||||
DomainValidation: NewNSDomainValidationConfig(),
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultNSUserPlanConfig() *NSPlanConfig {
|
||||
return &NSPlanConfig{
|
||||
SupportCountryRoutes: true,
|
||||
SupportChinaProvinceRoutes: true,
|
||||
SupportISPRoutes: true,
|
||||
SupportAgentRoutes: true,
|
||||
SupportPublicRoutes: true,
|
||||
MaxCustomRoutes: 0,
|
||||
MaxLoadBalanceRecordsPerRecord: 100,
|
||||
MinTTL: 60,
|
||||
MaxDomains: 100,
|
||||
MaxRecordsPerDomain: 1000,
|
||||
SupportRecordStats: true,
|
||||
SupportDomainAlias: false,
|
||||
SupportAPI: false,
|
||||
}
|
||||
}
|
||||
|
||||
type NSUserConfig struct {
|
||||
DefaultClusterId int64 `json:"defaultClusterId"` // 默认部署到的集群
|
||||
DefaultPlanConfig *NSPlanConfig `json:"defaultPlanConfig"` // 默认套餐设置
|
||||
DomainValidation *NSDomainValidationConfig `json:"domainValidation"` // 域名验证设置
|
||||
}
|
||||
Reference in New Issue
Block a user