Documentation ¶
Index ¶
- Variables
- func TypeParserFactory(...) routing.FunctionParser
- type Dns
- func (s *Dns) CheckUpstreamsFormat() error
- func (s *Dns) InitUpstreams()
- func (s *Dns) RequestSelect(qname string, qtype dnsmessage.Type) (upstreamIndex consts.DnsRequestOutboundIndex, upstream *Upstream, err error)
- func (s *Dns) ResponseSelect(msg *dnsmessage.Message, fromUpstream *Upstream) (upstreamIndex consts.DnsResponseOutboundIndex, upstream *Upstream, err error)
- type NewOption
- type RequestMatcher
- type RequestMatcherBuilder
- type ResponseMatcher
- type ResponseMatcherBuilder
- type Upstream
- type UpstreamResolver
- type UpstreamScheme
Constants ¶
This section is empty.
Variables ¶
View Source
var BadUpstreamFormatError = fmt.Errorf("bad upstream format")
View Source
var (
FormatError = fmt.Errorf("format error")
)
View Source
var ValidCidrChars = trie.NewValidChars([]byte{'0', '1'})
Functions ¶
func TypeParserFactory ¶
func TypeParserFactory(callback func(f *config_parser.Function, types []dnsmessage.Type, overrideOutbound *routing.Outbound) (err error)) routing.FunctionParser
Types ¶
type Dns ¶
type Dns struct {
// contains filtered or unexported fields
}
func (*Dns) CheckUpstreamsFormat ¶ added in v0.1.2
func (*Dns) InitUpstreams ¶
func (s *Dns) InitUpstreams()
func (*Dns) RequestSelect ¶
func (s *Dns) RequestSelect(qname string, qtype dnsmessage.Type) (upstreamIndex consts.DnsRequestOutboundIndex, upstream *Upstream, err error)
func (*Dns) ResponseSelect ¶
func (s *Dns) ResponseSelect(msg *dnsmessage.Message, fromUpstream *Upstream) (upstreamIndex consts.DnsResponseOutboundIndex, upstream *Upstream, err error)
type RequestMatcher ¶
type RequestMatcher struct {
// contains filtered or unexported fields
}
func (*RequestMatcher) Match ¶
func (m *RequestMatcher) Match( qName string, qType dnsmessage.Type, ) (upstreamIndex consts.DnsRequestOutboundIndex, err error)
type RequestMatcherBuilder ¶
type RequestMatcherBuilder struct {
// contains filtered or unexported fields
}
func NewRequestMatcherBuilder ¶
func NewRequestMatcherBuilder(log *logrus.Logger, rules []*config_parser.RoutingRule, upstreamName2Id map[string]uint8, fallback config.FunctionOrString) (b *RequestMatcherBuilder, err error)
func (*RequestMatcherBuilder) Build ¶
func (b *RequestMatcherBuilder) Build() (matcher *RequestMatcher, err error)
type ResponseMatcher ¶
type ResponseMatcher struct {
// contains filtered or unexported fields
}
func (*ResponseMatcher) Match ¶
func (m *ResponseMatcher) Match( qName string, qType dnsmessage.Type, ips []netip.Addr, upstream consts.DnsRequestOutboundIndex, ) (upstreamIndex consts.DnsResponseOutboundIndex, err error)
type ResponseMatcherBuilder ¶
type ResponseMatcherBuilder struct {
// contains filtered or unexported fields
}
func NewResponseMatcherBuilder ¶
func NewResponseMatcherBuilder(log *logrus.Logger, rules []*config_parser.RoutingRule, upstreamName2Id map[string]uint8, fallback config.FunctionOrString) (b *ResponseMatcherBuilder, err error)
func (*ResponseMatcherBuilder) Build ¶
func (b *ResponseMatcherBuilder) Build() (matcher *ResponseMatcher, err error)
type Upstream ¶
type Upstream struct { Scheme UpstreamScheme Hostname string Port uint16 *netutils.Ip46 }
func NewUpstream ¶
func (*Upstream) SupportedNetworks ¶
func (u *Upstream) SupportedNetworks() (ipversions []consts.IpVersionStr, l4protos []consts.L4ProtoStr)
type UpstreamResolver ¶
type UpstreamResolver struct { Raw *url.URL // FinishInitCallback may be invoked again if err is not nil FinishInitCallback func(raw *url.URL, upstream *Upstream) (err error) // contains filtered or unexported fields }
func (*UpstreamResolver) GetUpstream ¶
func (u *UpstreamResolver) GetUpstream() (_ *Upstream, err error)
type UpstreamScheme ¶
type UpstreamScheme string
const ( UpstreamScheme_TCP UpstreamScheme = "tcp" UpstreamScheme_UDP UpstreamScheme = "udp" UpstreamScheme_TCP_UDP UpstreamScheme = "tcp+udp" )
func ParseRawUpstream ¶
func (UpstreamScheme) ContainsTcp ¶
func (s UpstreamScheme) ContainsTcp() bool
Click to show internal directories.
Click to hide internal directories.