Versions in this module Expand all Collapse all v1 v1.24.4 Aug 19, 2016 Changes in this version + var AlwaysUseIP = DomainStrategy(1) + var DomainAsIs = DomainStrategy(0) + var ErrInvalidRule = errors.New("Invalid Rule") + var ErrNoRuleApplicable = errors.New("No rule applicable") + var UseIPIfNonMatch = DomainStrategy(2) + type AnyCondition []Condition + func NewAnyCondition() *AnyCondition + func (this *AnyCondition) Add(cond Condition) *AnyCondition + func (this *AnyCondition) Apply(dest v2net.Destination) bool + func (this *AnyCondition) Len() int + type CIDRMatcher struct + func NewCIDRMatcher(ipnet string) (*CIDRMatcher, error) + func (this *CIDRMatcher) Apply(dest v2net.Destination) bool + type Condition interface + Apply func(dest v2net.Destination) bool + type ConditionChan []Condition + func NewConditionChan() *ConditionChan + func (this *ConditionChan) Add(cond Condition) *ConditionChan + func (this *ConditionChan) Apply(dest v2net.Destination) bool + func (this *ConditionChan) Len() int + type DomainStrategy int + type IPv4Matcher struct + func NewIPv4Matcher(ipnet *v2net.IPNet) *IPv4Matcher + func (this *IPv4Matcher) Apply(dest v2net.Destination) bool + type NetworkMatcher struct + func NewNetworkMatcher(network *v2net.NetworkList) *NetworkMatcher + func (this *NetworkMatcher) Apply(dest v2net.Destination) bool + type PlainDomainMatcher struct + func NewPlainDomainMatcher(pattern string) *PlainDomainMatcher + func (this *PlainDomainMatcher) Apply(dest v2net.Destination) bool + type PortMatcher struct + func NewPortMatcher(portRange v2net.PortRange) *PortMatcher + func (this *PortMatcher) Apply(dest v2net.Destination) bool + type RegexpDomainMatcher struct + func NewRegexpDomainMatcher(pattern string) (*RegexpDomainMatcher, error) + func (this *RegexpDomainMatcher) Apply(dest v2net.Destination) bool + type Router struct + func NewRouter(config *RouterRuleConfig, space app.Space) *Router + func (this *Router) Release() + func (this *Router) ResolveIP(dest v2net.Destination) []v2net.Destination + func (this *Router) TakeDetour(dest v2net.Destination) (string, error) + type RouterFactory struct + func (this *RouterFactory) Create(rawConfig interface{}, space app.Space) (router.Router, error) + type RouterRuleConfig struct + DomainStrategy DomainStrategy + Rules []*Rule + type RoutingEntry struct + func (this *RoutingEntry) Expired() bool + func (this *RoutingEntry) Extend() + type RoutingTable struct + func NewRoutingTable() *RoutingTable + func (this *RoutingTable) Cleanup() + func (this *RoutingTable) Get(destination string) (bool, string, error) + func (this *RoutingTable) Set(destination string, tag string, err error) + type Rule struct + Condition Condition + Tag string + func NewChinaIPRule(tag string) *Rule + func NewChinaSitesRule(tag string) *Rule + func (this *Rule) Apply(dest v2net.Destination) bool