dnsconfigs

package
v0.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2022 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultRouteCode = "default"

Variables

View Source
var AllDefaultChinaProvinceRoutes = []*Route{
	{
		Name:       "北京市",
		Code:       "china:province:beijing",
		AliasNames: []string{"北京市", "北京"},
	},
	{
		Name:       "天津市",
		Code:       "china:province:tianjin",
		AliasNames: []string{"天津市", "天津"},
	},
	{
		Name:       "河北省",
		Code:       "china:province:heibei",
		AliasNames: []string{"河北省"},
	},
	{
		Name:       "山西省",
		Code:       "china:province:shanxi",
		AliasNames: []string{"山西省"},
	},
	{
		Name:       "内蒙古自治区",
		Code:       "china:province:neimenggu",
		AliasNames: []string{"内蒙古自治区", "内蒙古"},
	},
	{
		Name:       "辽宁省",
		Code:       "china:province:liaoning",
		AliasNames: []string{"辽宁省"},
	},
	{
		Name:       "吉林省",
		Code:       "china:jilin",
		AliasNames: []string{"吉林省"},
	},
	{
		Name:       "黑龙江省",
		Code:       "china:province:heilongjiang",
		AliasNames: []string{"黑龙江省"},
	},
	{
		Name:       "上海市",
		Code:       "china:province:shanghai",
		AliasNames: []string{"上海市", "上海"},
	},
	{
		Name:       "江苏省",
		Code:       "china:province:jiangsu",
		AliasNames: []string{"江苏省"},
	},
	{
		Name:       "浙江省",
		Code:       "china:province:zhejiang",
		AliasNames: []string{"浙江省"},
	},
	{
		Name:       "安徽省",
		Code:       "china:province:anhui",
		AliasNames: []string{"安徽省"},
	},
	{
		Name:       "福建省",
		Code:       "china:province:fujian",
		AliasNames: []string{"福建省"},
	},
	{
		Name:       "江西省",
		Code:       "china:province:jiangxi",
		AliasNames: []string{"江西省"},
	},
	{
		Name:       "山东省",
		Code:       "china:province:shandong",
		AliasNames: []string{"山东省"},
	},
	{
		Name:       "河南省",
		Code:       "china:province:henan",
		AliasNames: []string{"河南省"},
	},
	{
		Name:       "湖北省",
		Code:       "china:province:hubei",
		AliasNames: []string{"湖北省"},
	},
	{
		Name:       "湖南省",
		Code:       "china:province:hunan",
		AliasNames: []string{"湖南省"},
	},
	{
		Name:       "广东省",
		Code:       "china:province:guangdong",
		AliasNames: []string{"广东省"},
	},
	{
		Name:       "广西壮族自治区",
		Code:       "china:province:guangxi",
		AliasNames: []string{"广西壮族自治区", "广西"},
	},
	{
		Name:       "海南省",
		Code:       "china:province:hainan",
		AliasNames: []string{"海南省"},
	},
	{
		Name:       "重庆市",
		Code:       "china:province:chongqing",
		AliasNames: []string{"重庆市", "重庆"},
	},
	{
		Name:       "四川省",
		Code:       "china:province:sichuan",
		AliasNames: []string{"四川省"},
	},
	{
		Name:       "贵州省",
		Code:       "china:province:guizhou",
		AliasNames: []string{"贵州省"},
	},
	{
		Name:       "云南省",
		Code:       "china:province:yunnan",
		AliasNames: []string{"云南省"},
	},
	{
		Name:       "西藏自治区",
		Code:       "china:province:xizang",
		AliasNames: []string{"西藏自治区", "西藏"},
	},
	{
		Name:       "陕西省",
		Code:       "china:province:shaanxi",
		AliasNames: []string{"陕西省"},
	},
	{
		Name:       "甘肃省",
		Code:       "china:province:gansu",
		AliasNames: []string{"甘肃省"},
	},
	{
		Name:       "青海省",
		Code:       "china:province:qinghai",
		AliasNames: []string{"青海省"},
	},
	{
		Name:       "宁夏回族自治区",
		Code:       "china:province:ningxia",
		AliasNames: []string{"宁夏回族自治区", "宁夏"},
	},
	{
		Name:       "新疆维吾尔自治区",
		Code:       "china:province:xinjiang",
		AliasNames: []string{"新疆维吾尔自治区", "新疆"},
	},
	{
		Name:       "香港特别行政区",
		Code:       "china:province:hk",
		AliasNames: []string{"香港特别行政区", "香港"},
	},
	{
		Name:       "澳门特别行政区",
		Code:       "china:province:mo",
		AliasNames: []string{"澳门特别行政区", "澳门"},
	},
	{
		Name:       "台湾省",
		Code:       "china:province:tw",
		AliasNames: []string{"台湾省"},
	},
}

AllDefaultChinaProvinceRoutes 中国地域线路

View Source
var AllDefaultISPRoutes = []*Route{
	{
		Name:       "电信",
		Code:       "isp:china_telecom",
		AliasNames: []string{"电信"},
	},
	{
		Name:       "联通",
		Code:       "isp:china_unicom",
		AliasNames: []string{"联通"},
	},
	{
		Name:       "移动",
		Code:       "isp:china_mobile",
		AliasNames: []string{"移动"},
	},
	{
		Name:       "鹏博士",
		Code:       "isp:china_drpeng",
		AliasNames: []string{"鹏博士"},
	},
	{
		Name:       "教育网",
		Code:       "isp:china_edu",
		AliasNames: []string{"教育网"},
	},
	{
		Name:       "歌华",
		Code:       "isp:china_gehua",
		AliasNames: []string{"歌华"},
	},
	{
		Name:       "铁通",
		Code:       "isp:china_tietong",
		AliasNames: []string{"铁通"},
	},
	{
		Name:       "阿里巴巴",
		Code:       "isp:alibaba",
		AliasNames: []string{"阿里巴巴"},
	},
	{
		Name:       "亚马逊",
		Code:       "isp:amazon",
		AliasNames: []string{"亚马逊"},
	},
	{
		Name:       "谷歌",
		Code:       "isp:google",
		AliasNames: []string{"谷歌"},
	},
	{
		Name:       "微软",
		Code:       "isp:microsoft",
		AliasNames: []string{"微软"},
	},
	{
		Name:       "腾讯",
		Code:       "isp:tencent",
		AliasNames: []string{"腾讯"},
	},
	{
		Name:       "阿里云",
		Code:       "isp:aliyun",
		AliasNames: []string{"阿里云"},
	},
}

AllDefaultISPRoutes 运营商线路

View Source
var AllDefaultRoutes = []*Route{
	{
		Name:       "默认线路",
		Code:       DefaultRouteCode,
		AliasNames: []string{"默认线路"},
	},
}

AllDefaultRoutes 默认线路

View Source
var AllDefaultWorldRegionRoutes = []*Route{}/* 240 elements not displayed */

AllDefaultWorldRegionRoutes 世界地域线路 参考:https://zh.wikipedia.org/wiki/%E5%9C%8B%E5%AE%B6%E5%9C%B0%E5%8D%80%E4%BB%A3%E7%A2%BC

Functions

func FindKeyAlgorithmTypeName

func FindKeyAlgorithmTypeName(algoType KeyAlgorithmType) string

func FindKeySecretTypeName

func FindKeySecretTypeName(secretType NSKeySecretType) string

Types

type ClusterDNSConfig

type ClusterDNSConfig struct {
	CNameRecords []string `yaml:"cnameRecords" json:"cnameRecords"` // 自动加入的CNAME
	TTL          int32    `yaml:"ttl" json:"ttl"`                   // 默认TTL,各个DNS服务商对记录的TTL的限制各有不同

	NodesAutoSync   bool `yaml:"nodesAutoSync" json:"nodesAutoSync"`     // 是否自动同步节点状态
	ServersAutoSync bool `yaml:"serversAutoSync" json:"serversAutoSync"` // 是否自动同步服务状态
}

ClusterDNSConfig 集群的DNS设置

type DNSHost

type DNSHost struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Protocol string `json:"protocol"`
}

type KeyAlgorithmDefinition

type KeyAlgorithmDefinition struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

func FindAllKeyAlgorithmTypes

func FindAllKeyAlgorithmTypes() []*KeyAlgorithmDefinition

type KeyAlgorithmType

type KeyAlgorithmType = string
const (
	KeyAlgorithmTypeHmacSHA1   KeyAlgorithmType = "hmac-sha1."
	KeyAlgorithmTypeHmacSHA224 KeyAlgorithmType = "hmac-sha224."
	KeyAlgorithmTypeHmacSHA256 KeyAlgorithmType = "hmac-sha256."
	KeyAlgorithmTypeHmacSHA384 KeyAlgorithmType = "hmac-sha384."
	KeyAlgorithmTypeHmacSHA512 KeyAlgorithmType = "hmac-sha512."
)

type NSAccessLogRef

type NSAccessLogRef struct {
	IsPrior           bool `yaml:"isPrior" json:"isPrior"`                     // 是否覆盖
	IsOn              bool `yaml:"isOn" json:"isOn"`                           // 是否启用
	LogMissingDomains bool `yaml:"logMissingDomains" json:"logMissingDomains"` // 是否记录找不到的域名
}

func (*NSAccessLogRef) Init

func (this *NSAccessLogRef) Init() error

type NSKeySecretType

type NSKeySecretType = string
const (
	NSKeySecretTypeClear  NSKeySecretType = "clear"
	NSKeySecretTypeBase64 NSKeySecretType = "base64"
)

type NSNodeConfig

type NSNodeConfig struct {
	Id              int64            `yaml:"id" json:"id"`
	NodeId          string           `yaml:"nodeId" json:"nodeId"`
	Secret          string           `yaml:"secret" json:"secret"`
	ClusterId       int64            `yaml:"clusterId" json:"clusterId"`
	AccessLogRef    *NSAccessLogRef  `yaml:"accessLogRef" json:"accessLogRef"`
	RecursionConfig *RecursionConfig `yaml:"recursionConfig" json:"recursionConfig"`
	// contains filtered or unexported fields
}

func (*NSNodeConfig) Init

func (this *NSNodeConfig) Init() error

func (*NSNodeConfig) PaddedId

func (this *NSNodeConfig) PaddedId() string

type NSSetting

type NSSetting struct {
}

type RecordTTL

type RecordTTL struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

func FindAllRecordTTL

func FindAllRecordTTL() []*RecordTTL

type RecordType

type RecordType = string
const (
	RecordTypeA     RecordType = "A"
	RecordTypeCNAME RecordType = "CNAME"
	RecordTypeAAAA  RecordType = "AAAA"
	RecordTypeNS    RecordType = "NS"
	RecordTypeMX    RecordType = "MX"
	RecordTypeSRV   RecordType = "SRV"
	RecordTypeTXT   RecordType = "TXT"
	RecordTypeCAA   RecordType = "CAA"
)

type RecordTypeDefinition

type RecordTypeDefinition struct {
	Type        RecordType `json:"type"`
	Description string     `json:"description"`
}

func FindAllRecordTypeDefinitions

func FindAllRecordTypeDefinitions() []*RecordTypeDefinition

type RecursionConfig

type RecursionConfig struct {
	IsOn          bool       `json:"isOn"`
	Hosts         []*DNSHost `json:"hosts"`
	UseLocalHosts bool       `json:"useLocalHosts"` // 自动从本机读取DNS
	AllowDomains  []string   `json:"allowDomains"`
	DenyDomains   []string   `json:"denyDomains"`
}

RecursionConfig 递归DNS设置

type Route

type Route struct {
	Name       string   `json:"name"`
	Code       string   `json:"code"`
	AliasNames []string `json:"aliasNames"`
}

func FindDefaultRoute

func FindDefaultRoute(code string) *Route

FindDefaultRoute 根据代号查找线路

type RouteRangeIPRange

type RouteRangeIPRange struct {
	IPFrom string `json:"ipFrom"`
	IPTo   string `json:"ipTo"`
	// contains filtered or unexported fields
}

RouteRangeIPRange IP范围配置

func (*RouteRangeIPRange) Contains

func (this *RouteRangeIPRange) Contains(ip uint64) bool

func (*RouteRangeIPRange) Init

func (this *RouteRangeIPRange) Init() error

type RouteRangeInterface

type RouteRangeInterface interface {
	Init() error
	Contains(ip uint64) bool
}

type RouteRangeType

type RouteRangeType = string
const (
	RouteRangeTypeIP RouteRangeType = "ipRange"
)

type TSIGConfig

type TSIGConfig struct {
	IsOn bool `yaml:"isOn" json:"isOn"`
}

TSIGConfig 配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL