Documentation ¶
Index ¶
- func ApplyRulesOptimizers(rules []*config_parser.RoutingRule, optimizers ...RulesOptimizer) ([]*config_parser.RoutingRule, error)
- func DeepCloneRules(rules []*config_parser.RoutingRule) (newRules []*config_parser.RoutingRule)
- type AliasOptimizer
- type DatReaderOptimizer
- type DeduplicateParamsOptimizer
- type DomainMatcher
- type DomainSet
- type FunctionParser
- func EmptyKeyPlainParserFactory(...) FunctionParser
- func IpParserFactory(...) FunctionParser
- func IpVersionParserFactory(...) FunctionParser
- func L4ProtoParserFactory(...) FunctionParser
- func MacParserFactory(...) FunctionParser
- func PlainParserFactory(...) FunctionParser
- func PortRangeParserFactory(...) FunctionParser
- func ProcessNameParserFactory(...) FunctionParser
- type MergeAndSortRulesOptimizer
- type Outbound
- type RulesBuilder
- type RulesOptimizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRulesOptimizers ¶
func ApplyRulesOptimizers(rules []*config_parser.RoutingRule, optimizers ...RulesOptimizer) ([]*config_parser.RoutingRule, error)
func DeepCloneRules ¶
func DeepCloneRules(rules []*config_parser.RoutingRule) (newRules []*config_parser.RoutingRule)
Types ¶
type AliasOptimizer ¶
type AliasOptimizer struct { }
func (*AliasOptimizer) Optimize ¶
func (o *AliasOptimizer) Optimize(rules []*config_parser.RoutingRule) ([]*config_parser.RoutingRule, error)
type DatReaderOptimizer ¶
type DatReaderOptimizer struct { LocationFinder *assets.LocationFinder Logger *logrus.Logger }
func (*DatReaderOptimizer) Optimize ¶
func (o *DatReaderOptimizer) Optimize(rules []*config_parser.RoutingRule) ([]*config_parser.RoutingRule, error)
type DeduplicateParamsOptimizer ¶
type DeduplicateParamsOptimizer struct { }
func (*DeduplicateParamsOptimizer) Optimize ¶
func (o *DeduplicateParamsOptimizer) Optimize(rules []*config_parser.RoutingRule) ([]*config_parser.RoutingRule, error)
type DomainMatcher ¶
type DomainSet ¶
type DomainSet struct { Key consts.RoutingDomainKey RuleIndex int Domains []string }
type FunctionParser ¶
type FunctionParser func(log *logrus.Logger, f *config_parser.Function, key string, paramValueGroup []string, overrideOutbound *Outbound) (err error)
func EmptyKeyPlainParserFactory ¶
func EmptyKeyPlainParserFactory(callback func(f *config_parser.Function, values []string, overrideOutbound *Outbound) (err error)) FunctionParser
EmptyKeyPlainParserFactory only accepts function with empty key.
func IpParserFactory ¶
func IpParserFactory(callback func(f *config_parser.Function, cidrs []netip.Prefix, overrideOutbound *Outbound) (err error)) FunctionParser
func IpVersionParserFactory ¶
func IpVersionParserFactory(callback func(f *config_parser.Function, ipVersion consts.IpVersionType, overrideOutbound *Outbound) (err error)) FunctionParser
func L4ProtoParserFactory ¶
func L4ProtoParserFactory(callback func(f *config_parser.Function, l4protoType consts.L4ProtoType, overrideOutbound *Outbound) (err error)) FunctionParser
func MacParserFactory ¶
func MacParserFactory(callback func(f *config_parser.Function, macAddrs [][6]byte, overrideOutbound *Outbound) (err error)) FunctionParser
func PlainParserFactory ¶
func PlainParserFactory(callback func(f *config_parser.Function, key string, paramValueGroup []string, overrideOutbound *Outbound) (err error)) FunctionParser
PlainParserFactory is for style unity.
func PortRangeParserFactory ¶
func PortRangeParserFactory(callback func(f *config_parser.Function, portRanges [][2]uint16, overrideOutbound *Outbound) (err error)) FunctionParser
func ProcessNameParserFactory ¶
func ProcessNameParserFactory(callback func(f *config_parser.Function, procNames [][consts.TaskCommLen]byte, overrideOutbound *Outbound) (err error)) FunctionParser
type MergeAndSortRulesOptimizer ¶
type MergeAndSortRulesOptimizer struct { }
func (*MergeAndSortRulesOptimizer) Optimize ¶
func (o *MergeAndSortRulesOptimizer) Optimize(rules []*config_parser.RoutingRule) ([]*config_parser.RoutingRule, error)
type Outbound ¶
func ParseOutbound ¶
func ParseOutbound(rawOutbound *config_parser.Function) (outbound *Outbound, err error)
type RulesBuilder ¶
type RulesBuilder struct {
// contains filtered or unexported fields
}
func NewRulesBuilder ¶
func NewRulesBuilder(log *logrus.Logger) *RulesBuilder
func (*RulesBuilder) Apply ¶
func (b *RulesBuilder) Apply(rules []*config_parser.RoutingRule) (err error)
func (*RulesBuilder) RegisterFunctionParser ¶
func (b *RulesBuilder) RegisterFunctionParser(funcName string, parser FunctionParser)
type RulesOptimizer ¶
type RulesOptimizer interface {
Optimize(rules []*config_parser.RoutingRule) ([]*config_parser.RoutingRule, error)
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.