Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorInvalidRule = errors.New("Invalid Rule") ErrorNoRuleApplicable = errors.New("No rule applicable") )
Functions ¶
This section is empty.
Types ¶
type AnyCondition ¶ added in v1.9.1
type AnyCondition []Condition
func NewAnyCondition ¶ added in v1.9.1
func NewAnyCondition() *AnyCondition
func (*AnyCondition) Add ¶ added in v1.9.1
func (this *AnyCondition) Add(cond Condition) *AnyCondition
func (*AnyCondition) Apply ¶ added in v1.9.1
func (this *AnyCondition) Apply(dest v2net.Destination) bool
func (*AnyCondition) Len ¶ added in v1.9.1
func (this *AnyCondition) Len() int
type CIDRMatcher ¶ added in v1.9.1
type CIDRMatcher struct {
// contains filtered or unexported fields
}
func NewCIDRMatcher ¶ added in v1.9.1
func NewCIDRMatcher(ipnet string) (*CIDRMatcher, error)
func (*CIDRMatcher) Apply ¶ added in v1.9.1
func (this *CIDRMatcher) Apply(dest v2net.Destination) bool
type Condition ¶ added in v1.9.1
type Condition interface {
Apply(dest v2net.Destination) bool
}
type ConditionChan ¶ added in v1.9.1
type ConditionChan []Condition
func NewConditionChan ¶ added in v1.9.1
func NewConditionChan() *ConditionChan
func (*ConditionChan) Add ¶ added in v1.9.1
func (this *ConditionChan) Add(cond Condition) *ConditionChan
func (*ConditionChan) Apply ¶ added in v1.9.1
func (this *ConditionChan) Apply(dest v2net.Destination) bool
func (*ConditionChan) Len ¶ added in v1.9.1
func (this *ConditionChan) Len() int
type IPv4Matcher ¶ added in v1.9.1
type IPv4Matcher struct {
// contains filtered or unexported fields
}
func NewIPv4Matcher ¶ added in v1.9.1
func NewIPv4Matcher(ipnet *v2net.IPNet) *IPv4Matcher
func (*IPv4Matcher) Apply ¶ added in v1.9.1
func (this *IPv4Matcher) Apply(dest v2net.Destination) bool
type NetworkMatcher ¶ added in v1.9.1
type NetworkMatcher struct {
// contains filtered or unexported fields
}
func NewNetworkMatcher ¶ added in v1.9.1
func NewNetworkMatcher(network *v2net.NetworkList) *NetworkMatcher
func (*NetworkMatcher) Apply ¶ added in v1.9.1
func (this *NetworkMatcher) Apply(dest v2net.Destination) bool
type PlainDomainMatcher ¶ added in v1.9.1
type PlainDomainMatcher struct {
// contains filtered or unexported fields
}
func NewPlainDomainMatcher ¶ added in v1.9.1
func NewPlainDomainMatcher(pattern string) *PlainDomainMatcher
func (*PlainDomainMatcher) Apply ¶ added in v1.9.1
func (this *PlainDomainMatcher) Apply(dest v2net.Destination) bool
type PortMatcher ¶ added in v1.9.1
type PortMatcher struct {
// contains filtered or unexported fields
}
func NewPortMatcher ¶ added in v1.9.1
func NewPortMatcher(portRange v2net.PortRange) *PortMatcher
func (*PortMatcher) Apply ¶ added in v1.9.1
func (this *PortMatcher) Apply(dest v2net.Destination) bool
type RegexpDomainMatcher ¶ added in v1.9.1
type RegexpDomainMatcher struct {
// contains filtered or unexported fields
}
func NewRegexpDomainMatcher ¶ added in v1.9.1
func NewRegexpDomainMatcher(pattern string) (*RegexpDomainMatcher, error)
func (*RegexpDomainMatcher) Apply ¶ added in v1.9.1
func (this *RegexpDomainMatcher) Apply(dest v2net.Destination) bool
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶ added in v1.1.2
func NewRouter(config *RouterRuleConfig) *Router
func (*Router) TakeDetour ¶
func (this *Router) TakeDetour(dest v2net.Destination) (string, error)
type RouterFactory ¶
type RouterFactory struct { }
type RouterRuleConfig ¶ added in v1.1.2
type Rule ¶ added in v1.1.2
func NewChinaIPRule ¶ added in v1.9.1
func NewChinaSitesRule ¶ added in v1.9.1
Click to show internal directories.
Click to hide internal directories.