Documentation
¶
Index ¶
- type AbstractDatasourceGroupOption
- type AbstractDatasourceOption
- type AbstractProviderOption
- type CloudflareProviderOption
- type CommandDatasourceOption
- type ConnectOption
- type DNSOption
- type DatasourceGroupFailoverOption
- type DatasourceGroupSumOption
- type DatasourceIsGroup
- type DatasourceOption
- type DomainOption
- type DualStack
- type HTTPDatasourceOption
- type HTTPOption
- type LogOption
- type NetlinkDatasourceOption
- type Options
- type ProviderOption
- type VariantOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractDatasourceGroupOption ¶
type AbstractDatasourceGroupOption struct {
AbstractDatasourceOption
Datasources []string `json:"datasources" yaml:"datasources"`
}
func (AbstractDatasourceGroupOption) Group ¶
func (x AbstractDatasourceGroupOption) Group() []string
func (AbstractDatasourceGroupOption) UsedType ¶
func (AbstractDatasourceGroupOption) UsedType() string
type AbstractDatasourceOption ¶
type AbstractDatasourceOption struct {
Type string `json:"type" yaml:"type"`
Name string `json:"name" yaml:"name"`
}
func (AbstractDatasourceOption) UsedType ¶
func (AbstractDatasourceOption) UsedType() string
type AbstractProviderOption ¶
type AbstractProviderOption struct {
Type string `json:"type" yaml:"type"`
Name string `json:"name" yaml:"name"`
}
func (AbstractProviderOption) UsedType ¶
func (AbstractProviderOption) UsedType() string
type CloudflareProviderOption ¶
type CloudflareProviderOption struct {
AbstractProviderOption
ConnectOption
HTTPOption
Token string `json:"token" yaml:"token"`
Proxy bool `json:"proxy,omitempty" yaml:"proxy,omitempty"`
}
func (CloudflareProviderOption) UsedType ¶
func (CloudflareProviderOption) UsedType() string
type CommandDatasourceOption ¶
type CommandDatasourceOption struct {
AbstractDatasourceOption
Cmd DualStack[string] `json:"cmd" yaml:"cmd"`
Shell string `json:"shell,omitempty" yaml:"shell,omitempty"`
ExitCode int `json:"exitCode,omitempty" yaml:"exitCode,omitempty"`
Env badyaml.EnvironmentVariable `json:"env,omitempty" yaml:"env,omitempty"`
}
func (CommandDatasourceOption) UsedType ¶
func (CommandDatasourceOption) UsedType() string
type ConnectOption ¶
type ConnectOption struct {
// @LANG.EN_US
// Firewall Mark
//
// @LANG.ZH_CN
// 防火墙标记
//
// @Platform linux
Fwmark uint `json:"fwmark,omitempty" yaml:"fwmark,omitempty"`
// @LANG.EN_US
// DNS configuration
//
// @LANG.ZH_CN
// DNS 配置
DNS DNSOption `json:"dns,omitempty" yaml:"dns,omitempty"`
// @LANG.EN_US
// The IPv4 address to bind when establishing outgoing connections.
//
// @LANG.ZH_CN
// 建立出站连接时绑定的 IPv4 地址。
BindAddress4 string `json:"bindAddress4,omitempty" yaml:"bindAddress4,omitempty"`
// @LANG.EN_US
// The IPv6 address to bind when establishing outgoing connections.
//
// @LANG.ZH_CN
// 建立出站连接时绑定的 IPv6 地址。
BindAddress6 string `json:"bindAddress6,omitempty" yaml:"bindAddress6,omitempty"`
// @LANG.EN_US
// control underlay dialer's priority of establish a new connection, based on Happy Eyeball
// "ipv4_only": Only attempt IPv4 connections. All AAAA records are ignored, no IPv6 fallback.
// "prefer_ipv4": Prefer IPv4 and race with IPv6. If IPv4 connectivity fails, fall back to IPv6.
// "ipv6_only": Only attempt IPv6 connections. All A records are ignored, no IPv4 fallback.
// "prefer_ipv6": Prefer IPv6 and race with IPv4. If IPv6 connectivity fails, fall back to IPv4.
//
// @LANG.ZH_CN
// 控制底层拨号器建立连接的优先级,基于 Happy Eyeball.
// "ipv4_only": 仅尝试 IPv4 连接,忽略所有 AAAA 记录,不回退到 IPv6。
// "ipv6_only": 仅尝试 IPv6 连接,忽略所有 A 记录,不回退到 IPv4。
// "prefer_ipv4": 优先尝试 IPv4,同时发起 IPv6 竞速。若 IPv4 连接不可达,则回退到 IPv6。
// "prefer_ipv6": 优先尝试 IPv6,同时发起 IPv4 竞速。若 IPv6 连接不可达,则回退到 IPv4。
//
// @Values ipv4_only, prefer_ipv4, ipv6_only, prefer_ipv6
DialStrategy dialerx.DialStrategy `json:"dialStrategy,omitempty" yaml:"dialStrategy,omitempty"`
// @LANG.EN_US
// The network interface to bind when establishing connections, can be an interface name or index.
//
// @LANG.ZH_CN
// 建立连接时绑定的网络接口,可以是接口名称或索引。
BindInterface badyaml.StringOrNumber `json:"bindInterface,omitempty" yaml:"bindInterface,omitempty"`
}
ConnectOption @Shared @LANG.EN_US Connect Option @LANG.ZH_CN 连接选项
func (ConnectOption) Options ¶
func (co ConnectOption) Options() ([]dialerx.DialerOption, error)
type DNSOption ¶
type DNSOption struct {
Type string `json:"type" yaml:"type"`
Server string `json:"server" yaml:"server"`
Port uint16 `json:"port,omitempty" yaml:"port,omitempty"`
}
func (*DNSOption) NewTransport ¶
func (*DNSOption) UnmarshalYAML ¶
type DatasourceGroupFailoverOption ¶
type DatasourceGroupFailoverOption struct {
AbstractDatasourceGroupOption
}
func (DatasourceGroupFailoverOption) UsedType ¶
func (DatasourceGroupFailoverOption) UsedType() string
type DatasourceGroupSumOption ¶
type DatasourceGroupSumOption struct {
AbstractDatasourceGroupOption
IgnoreDownstreamError bool `json:"ignoreDownstreamError,omitempty" yaml:"ignoreDownstreamError,omitempty"`
}
func (DatasourceGroupSumOption) UsedType ¶
func (DatasourceGroupSumOption) UsedType() string
type DatasourceIsGroup ¶
type DatasourceIsGroup interface {
Group() []string
}
type DatasourceOption ¶
type DatasourceOption struct {
AbstractDatasourceOption
Option any `json:"-" yaml:"-"`
}
func (*DatasourceOption) UnmarshalYAML ¶
func (O *DatasourceOption) UnmarshalYAML(bs []byte) error
type DomainOption ¶
type DomainOption struct {
Domain badyaml.DomainName `json:"domain" yaml:"domain"`
Enabled bool `json:"enabled" yaml:"enabled"`
Provider string `json:"provider" yaml:"provider"`
DataSource string `json:"datasource" yaml:"datasource"`
TTL uint32 `json:"ttl,omitempty" yaml:"ttl,omitempty"`
IPv4 bool `json:"ipv4,omitempty" yaml:"ipv4,omitempty"`
IPv6 bool `json:"ipv6,omitempty" yaml:"ipv6,omitempty"`
Interval badyaml.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
Timeout badyaml.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}
type DualStack ¶
type DualStack[T any] struct { IPv4 T `json:"ipv4" yaml:"ipv4"` IPv6 T `json:"ipv6" yaml:"ipv6"` }
type HTTPDatasourceOption ¶
type HTTPDatasourceOption struct {
AbstractDatasourceOption
ConnectOption
HTTPOption
Url badyaml.URL `json:"url" yaml:"url"`
MatchJson badyaml.StringOrObject[DualStack[string]] `json:"matchJson,omitempty" yaml:"matchJson,omitempty"`
MatchRegex badyaml.StringOrObject[DualStack[string]] `json:"matchRegex,omitempty" yaml:"matchRegex,omitempty"`
Method badyaml.HTTPMethod `json:"method,omitempty" yaml:"method,omitempty"`
Headers badyaml.HTTPHeader `json:"headers,omitempty" yaml:"headers,omitempty"`
}
func (HTTPDatasourceOption) UsedType ¶
func (HTTPDatasourceOption) UsedType() string
type HTTPOption ¶
type HTTPOption struct {
UseSystemProxy bool `json:"useSystemProxy,omitempty" yaml:"useSystemProxy,omitempty"`
HTTPProxy string `json:"httpProxy,omitempty" yaml:"httpProxy,omitempty"`
HTTPSProxy string `json:"httpsProxy,omitempty" yaml:"httpsProxy,omitempty"`
}
func (HTTPOption) Options ¶
func (ho HTTPOption) Options() ([]httpxx.HTTPClientOption, error)
type LogOption ¶
type LogOption struct {
// @Values trace,debug,info,warn,error,dpanic,panic,fatal
// @LANG.EN_US Set the log level.
// @LANG.ZH_CN 设置日志等级
Level badyaml.LogLevel `json:"level,omitempty" yaml:"level,omitempty"`
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
Output string `json:"output,omitempty" yaml:"output,omitempty"`
}
type NetlinkDatasourceOption ¶
type NetlinkDatasourceOption struct {
AbstractDatasourceOption
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Index int `json:"index,omitempty" yaml:"index,omitempty"`
AllowPrivate bool `json:"allowPrivate,omitempty" yaml:"allowPrivate,omitempty"`
}
func (NetlinkDatasourceOption) UsedType ¶
func (NetlinkDatasourceOption) UsedType() string
type Options ¶
type Options struct {
Log LogOption `json:"log,omitempty" yaml:"log,omitempty"`
DataSources []DatasourceOption `json:"datasources" yaml:"datasources"`
Providers []ProviderOption `json:"providers" yaml:"providers"`
Domains []DomainOption `json:"domains" yaml:"domains"`
}
type ProviderOption ¶
type ProviderOption struct {
AbstractProviderOption
Option any `json:"-" yaml:"-"`
}
func (*ProviderOption) UnmarshalYAML ¶
func (O *ProviderOption) UnmarshalYAML(bs []byte) error
type VariantOption ¶
type VariantOption interface {
UsedType() string
}
Click to show internal directories.
Click to hide internal directories.