50 lines
1.6 KiB
Go
50 lines
1.6 KiB
Go
// 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"` // 域名验证设置
|
|
}
|