Documentation ¶
Index ¶
- Variables
- type AnyCondition
- type CIDRMatcher
- type Condition
- type ConditionChan
- type DomainStrategy
- type IPv4Matcher
- type NetworkMatcher
- type PlainDomainMatcher
- type PortMatcher
- type RegexpDomainMatcher
- type Router
- type RouterFactory
- type RouterRuleConfig
- type RoutingEntry
- type RoutingTable
- type Rule
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DomainAsIs = DomainStrategy(0) AlwaysUseIP = DomainStrategy(1) UseIPIfNonMatch = DomainStrategy(2) )
View Source
var ( ErrInvalidRule = errors.New("Invalid Rule") ErrNoRuleApplicable = 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 DomainStrategy ¶
type DomainStrategy 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 (*Router) ResolveIP ¶
func (this *Router) ResolveIP(dest v2net.Destination) []v2net.Destination
@Private
func (*Router) TakeDetour ¶
func (this *Router) TakeDetour(dest v2net.Destination) (string, error)
type RouterFactory ¶
type RouterFactory struct { }
type RouterRuleConfig ¶
type RouterRuleConfig struct { Rules []*Rule DomainStrategy DomainStrategy }
type RoutingEntry ¶
type RoutingEntry struct {
// contains filtered or unexported fields
}
func (*RoutingEntry) Expired ¶
func (this *RoutingEntry) Expired() bool
func (*RoutingEntry) Extend ¶
func (this *RoutingEntry) Extend()
type RoutingTable ¶
func NewRoutingTable ¶
func NewRoutingTable() *RoutingTable
func (*RoutingTable) Cleanup ¶
func (this *RoutingTable) Cleanup()
Click to show internal directories.
Click to hide internal directories.