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 uint16) (upstreamIndex consts.DnsRequestOutboundIndex, upstream *Upstream, err error)
- func (s *Dns) ResponseSelect(msg *dnsmessage.Msg, 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 ErrBadUpstreamFormat = fmt.Errorf("bad upstream format")
View Source
var (
ErrFormat = fmt.Errorf("format error")
)
Functions ¶
func TypeParserFactory ¶
func TypeParserFactory(callback func(f *config_parser.Function, types []uint16, 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 (*Dns) ResponseSelect ¶
func (s *Dns) ResponseSelect(msg *dnsmessage.Msg, 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 uint16, ) (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 uint16, 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 Path string *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 Network string // 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" UpstreamScheme_TLS UpstreamScheme = "tls" UpstreamScheme_QUIC UpstreamScheme = "quic" UpstreamScheme_HTTPS UpstreamScheme = "https" UpstreamScheme_H3 UpstreamScheme = "h3" )
func ParseRawUpstream ¶
func (UpstreamScheme) ContainsTcp ¶
func (s UpstreamScheme) ContainsTcp() bool
Click to show internal directories.
Click to hide internal directories.