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 ¶
type AnyCondition []Condition
func NewAnyCondition ¶
func NewAnyCondition() *AnyCondition
func (*AnyCondition) Add ¶
func (this *AnyCondition) Add(cond Condition) *AnyCondition
func (*AnyCondition) Apply ¶
func (this *AnyCondition) Apply(dest v2net.Destination) bool
func (*AnyCondition) Len ¶
func (this *AnyCondition) Len() int
type CIDRMatcher ¶
type CIDRMatcher struct {
// contains filtered or unexported fields
}
func NewCIDRMatcher ¶
func NewCIDRMatcher(ipnet string) (*CIDRMatcher, error)
func (*CIDRMatcher) Apply ¶
func (this *CIDRMatcher) Apply(dest v2net.Destination) bool
type Condition ¶
type Condition interface {
Apply(dest v2net.Destination) bool
}
type ConditionChan ¶
type ConditionChan []Condition
func NewConditionChan ¶
func NewConditionChan() *ConditionChan
func (*ConditionChan) Add ¶
func (this *ConditionChan) Add(cond Condition) *ConditionChan
func (*ConditionChan) Apply ¶
func (this *ConditionChan) Apply(dest v2net.Destination) bool
func (*ConditionChan) Len ¶
func (this *ConditionChan) Len() int
type IPv4Matcher ¶
type IPv4Matcher struct {
// contains filtered or unexported fields
}
func NewIPv4Matcher ¶
func NewIPv4Matcher(ipnet *v2net.IPNet) *IPv4Matcher
func (*IPv4Matcher) Apply ¶
func (this *IPv4Matcher) Apply(dest v2net.Destination) bool
type NetworkMatcher ¶
type NetworkMatcher struct {
// contains filtered or unexported fields
}
func NewNetworkMatcher ¶
func NewNetworkMatcher(network *v2net.NetworkList) *NetworkMatcher
func (*NetworkMatcher) Apply ¶
func (this *NetworkMatcher) Apply(dest v2net.Destination) bool
type PlainDomainMatcher ¶
type PlainDomainMatcher struct {
// contains filtered or unexported fields
}
func NewPlainDomainMatcher ¶
func NewPlainDomainMatcher(pattern string) *PlainDomainMatcher
func (*PlainDomainMatcher) Apply ¶
func (this *PlainDomainMatcher) Apply(dest v2net.Destination) bool
type PortMatcher ¶
type PortMatcher struct {
// contains filtered or unexported fields
}
func NewPortMatcher ¶
func NewPortMatcher(portRange v2net.PortRange) *PortMatcher
func (*PortMatcher) Apply ¶
func (this *PortMatcher) Apply(dest v2net.Destination) bool
type RegexpDomainMatcher ¶
type RegexpDomainMatcher struct {
// contains filtered or unexported fields
}
func NewRegexpDomainMatcher ¶
func NewRegexpDomainMatcher(pattern string) (*RegexpDomainMatcher, error)
func (*RegexpDomainMatcher) Apply ¶
func (this *RegexpDomainMatcher) Apply(dest v2net.Destination) bool
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(config *RouterRuleConfig) *Router
func (*Router) TakeDetour ¶
func (this *Router) TakeDetour(dest v2net.Destination) (string, error)
type RouterFactory ¶
type RouterFactory struct { }
type RouterRuleConfig ¶
Click to show internal directories.
Click to hide internal directories.