Documentation ¶
Index ¶
- Variables
- func NewDNSRule(ctx context.Context, logger log.ContextLogger, options option.DNSRule, ...) (adapter.DNSRule, error)
- func NewDNSRuleAction(logger logger.ContextLogger, action option.DNSRuleAction) adapter.RuleAction
- func NewHeadlessRule(ctx context.Context, options option.HeadlessRule) (adapter.HeadlessRule, error)
- func NewRule(ctx context.Context, logger log.ContextLogger, options option.Rule, ...) (adapter.Rule, error)
- func NewRuleAction(ctx context.Context, logger logger.ContextLogger, action option.RuleAction) (adapter.RuleAction, error)
- func NewRuleSet(ctx context.Context, logger logger.ContextLogger, options option.RuleSet) (adapter.RuleSet, error)
- type AdGuardDomainItem
- type AuthUserItem
- type ClashModeItem
- type ClientItem
- type DefaultDNSRule
- func (r *DefaultDNSRule) Action() adapter.RuleAction
- func (r *DefaultDNSRule) Close() error
- func (r *DefaultDNSRule) Match(metadata *adapter.InboundContext) bool
- func (r *DefaultDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
- func (r *DefaultDNSRule) Start() error
- func (r *DefaultDNSRule) String() string
- func (r *DefaultDNSRule) Type() string
- func (r *DefaultDNSRule) UpdateGeosite() error
- func (r *DefaultDNSRule) WithAddressLimit() bool
- type DefaultHeadlessRule
- func (r *DefaultHeadlessRule) Action() adapter.RuleAction
- func (r *DefaultHeadlessRule) Close() error
- func (r *DefaultHeadlessRule) Match(metadata *adapter.InboundContext) bool
- func (r *DefaultHeadlessRule) Start() error
- func (r *DefaultHeadlessRule) String() string
- func (r *DefaultHeadlessRule) Type() string
- func (r *DefaultHeadlessRule) UpdateGeosite() error
- type DefaultRule
- func (r *DefaultRule) Action() adapter.RuleAction
- func (r *DefaultRule) Close() error
- func (r *DefaultRule) Match(metadata *adapter.InboundContext) bool
- func (r *DefaultRule) Start() error
- func (r *DefaultRule) String() string
- func (r *DefaultRule) Type() string
- func (r *DefaultRule) UpdateGeosite() error
- type DomainItem
- type DomainKeywordItem
- type DomainRegexItem
- type GeoIPItem
- type GeositeItem
- type IPCIDRItem
- type IPIsPrivateItem
- type IPVersionItem
- type InboundItem
- type LocalRuleSet
- func (s *LocalRuleSet) Cleanup()
- func (s *LocalRuleSet) Close() error
- func (s *LocalRuleSet) DecRef()
- func (s *LocalRuleSet) ExtractIPSet() []*netipx.IPSet
- func (s *LocalRuleSet) IncRef()
- func (s *LocalRuleSet) Match(metadata *adapter.InboundContext) bool
- func (s *LocalRuleSet) Metadata() adapter.RuleSetMetadata
- func (s *LocalRuleSet) Name() string
- func (s *LocalRuleSet) PostStart() error
- func (s *LocalRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
- func (s *LocalRuleSet) StartContext(ctx context.Context, startContext *adapter.HTTPStartContext) error
- func (s *LocalRuleSet) String() string
- func (s *LocalRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
- type LogicalDNSRule
- func (r *LogicalDNSRule) Action() adapter.RuleAction
- func (r *LogicalDNSRule) Close() error
- func (r *LogicalDNSRule) Match(metadata *adapter.InboundContext) bool
- func (r *LogicalDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
- func (r *LogicalDNSRule) Start() error
- func (r *LogicalDNSRule) String() string
- func (r *LogicalDNSRule) Type() string
- func (r *LogicalDNSRule) UpdateGeosite() error
- func (r *LogicalDNSRule) WithAddressLimit() bool
- type LogicalHeadlessRule
- func (r *LogicalHeadlessRule) Action() adapter.RuleAction
- func (r *LogicalHeadlessRule) Close() error
- func (r *LogicalHeadlessRule) Match(metadata *adapter.InboundContext) bool
- func (r *LogicalHeadlessRule) Start() error
- func (r *LogicalHeadlessRule) String() string
- func (r *LogicalHeadlessRule) Type() string
- func (r *LogicalHeadlessRule) UpdateGeosite() error
- type LogicalRule
- func (r *LogicalRule) Action() adapter.RuleAction
- func (r *LogicalRule) Close() error
- func (r *LogicalRule) Match(metadata *adapter.InboundContext) bool
- func (r *LogicalRule) Start() error
- func (r *LogicalRule) String() string
- func (r *LogicalRule) Type() string
- func (r *LogicalRule) UpdateGeosite() error
- type NetworkIsConstrainedItem
- type NetworkIsExpensiveItem
- type NetworkItem
- type NetworkTypeItem
- type OutboundItem
- type PackageNameItem
- type PortItem
- type PortRangeItem
- type ProcessItem
- type ProcessPathItem
- type ProcessPathRegexItem
- type ProtocolItem
- type QueryTypeItem
- type RemoteRuleSet
- func (s *RemoteRuleSet) Cleanup()
- func (s *RemoteRuleSet) Close() error
- func (s *RemoteRuleSet) DecRef()
- func (s *RemoteRuleSet) ExtractIPSet() []*netipx.IPSet
- func (s *RemoteRuleSet) IncRef()
- func (s *RemoteRuleSet) Match(metadata *adapter.InboundContext) bool
- func (s *RemoteRuleSet) Metadata() adapter.RuleSetMetadata
- func (s *RemoteRuleSet) Name() string
- func (s *RemoteRuleSet) PostStart() error
- func (s *RemoteRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
- func (s *RemoteRuleSet) StartContext(ctx context.Context, startContext *adapter.HTTPStartContext) error
- func (s *RemoteRuleSet) String() string
- func (s *RemoteRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
- type RuleActionDNSRoute
- type RuleActionDNSRouteOptions
- type RuleActionDirect
- type RuleActionHijackDNS
- type RuleActionReject
- type RuleActionResolve
- type RuleActionRoute
- type RuleActionRouteOptions
- type RuleActionSniff
- type RuleItem
- type RuleSetItem
- type UserIdItem
- type UserItem
- type WIFIBSSIDItem
- type WIFISSIDItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadPortRange = E.New("bad port range")
Functions ¶
func NewDNSRule ¶
func NewDNSRuleAction ¶
func NewDNSRuleAction(logger logger.ContextLogger, action option.DNSRuleAction) adapter.RuleAction
func NewHeadlessRule ¶
func NewHeadlessRule(ctx context.Context, options option.HeadlessRule) (adapter.HeadlessRule, error)
func NewRuleAction ¶
func NewRuleAction(ctx context.Context, logger logger.ContextLogger, action option.RuleAction) (adapter.RuleAction, error)
Types ¶
type AdGuardDomainItem ¶
type AdGuardDomainItem struct {
// contains filtered or unexported fields
}
func NewAdGuardDomainItem ¶
func NewAdGuardDomainItem(ruleLines []string) *AdGuardDomainItem
func NewRawAdGuardDomainItem ¶
func NewRawAdGuardDomainItem(matcher *domain.AdGuardMatcher) *AdGuardDomainItem
func (*AdGuardDomainItem) Match ¶
func (r *AdGuardDomainItem) Match(metadata *adapter.InboundContext) bool
func (*AdGuardDomainItem) String ¶
func (r *AdGuardDomainItem) String() string
type AuthUserItem ¶
type AuthUserItem struct {
// contains filtered or unexported fields
}
func NewAuthUserItem ¶
func NewAuthUserItem(users []string) *AuthUserItem
func (*AuthUserItem) Match ¶
func (r *AuthUserItem) Match(metadata *adapter.InboundContext) bool
func (*AuthUserItem) String ¶
func (r *AuthUserItem) String() string
type ClashModeItem ¶
type ClashModeItem struct {
// contains filtered or unexported fields
}
func NewClashModeItem ¶
func NewClashModeItem(ctx context.Context, mode string) *ClashModeItem
func (*ClashModeItem) Match ¶
func (r *ClashModeItem) Match(metadata *adapter.InboundContext) bool
func (*ClashModeItem) Start ¶
func (r *ClashModeItem) Start() error
func (*ClashModeItem) String ¶
func (r *ClashModeItem) String() string
type ClientItem ¶
type ClientItem struct {
// contains filtered or unexported fields
}
func NewClientItem ¶
func NewClientItem(clients []string) *ClientItem
func (*ClientItem) Match ¶
func (r *ClientItem) Match(metadata *adapter.InboundContext) bool
func (*ClientItem) String ¶
func (r *ClientItem) String() string
type DefaultDNSRule ¶
type DefaultDNSRule struct {
// contains filtered or unexported fields
}
func NewDefaultDNSRule ¶
func NewDefaultDNSRule(ctx context.Context, logger log.ContextLogger, options option.DefaultDNSRule) (*DefaultDNSRule, error)
func (*DefaultDNSRule) Action ¶
func (r *DefaultDNSRule) Action() adapter.RuleAction
func (*DefaultDNSRule) Match ¶
func (r *DefaultDNSRule) Match(metadata *adapter.InboundContext) bool
func (*DefaultDNSRule) MatchAddressLimit ¶
func (r *DefaultDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
func (*DefaultDNSRule) UpdateGeosite ¶
func (r *DefaultDNSRule) UpdateGeosite() error
func (*DefaultDNSRule) WithAddressLimit ¶
func (r *DefaultDNSRule) WithAddressLimit() bool
type DefaultHeadlessRule ¶
type DefaultHeadlessRule struct {
// contains filtered or unexported fields
}
func NewDefaultHeadlessRule ¶
func NewDefaultHeadlessRule(ctx context.Context, options option.DefaultHeadlessRule) (*DefaultHeadlessRule, error)
func (*DefaultHeadlessRule) Action ¶
func (r *DefaultHeadlessRule) Action() adapter.RuleAction
func (*DefaultHeadlessRule) Match ¶
func (r *DefaultHeadlessRule) Match(metadata *adapter.InboundContext) bool
func (*DefaultHeadlessRule) UpdateGeosite ¶
func (r *DefaultHeadlessRule) UpdateGeosite() error
type DefaultRule ¶
type DefaultRule struct {
// contains filtered or unexported fields
}
func NewDefaultRule ¶
func NewDefaultRule(ctx context.Context, logger log.ContextLogger, options option.DefaultRule) (*DefaultRule, error)
func (*DefaultRule) Action ¶
func (r *DefaultRule) Action() adapter.RuleAction
func (*DefaultRule) Match ¶
func (r *DefaultRule) Match(metadata *adapter.InboundContext) bool
func (*DefaultRule) UpdateGeosite ¶
func (r *DefaultRule) UpdateGeosite() error
type DomainItem ¶
type DomainItem struct {
// contains filtered or unexported fields
}
func NewDomainItem ¶
func NewDomainItem(domains []string, domainSuffixes []string) *DomainItem
func NewRawDomainItem ¶
func NewRawDomainItem(matcher *domain.Matcher) *DomainItem
func (*DomainItem) Match ¶
func (r *DomainItem) Match(metadata *adapter.InboundContext) bool
func (*DomainItem) String ¶
func (r *DomainItem) String() string
type DomainKeywordItem ¶
type DomainKeywordItem struct {
// contains filtered or unexported fields
}
func NewDomainKeywordItem ¶
func NewDomainKeywordItem(keywords []string) *DomainKeywordItem
func (*DomainKeywordItem) Match ¶
func (r *DomainKeywordItem) Match(metadata *adapter.InboundContext) bool
func (*DomainKeywordItem) String ¶
func (r *DomainKeywordItem) String() string
type DomainRegexItem ¶
type DomainRegexItem struct {
// contains filtered or unexported fields
}
func NewDomainRegexItem ¶
func NewDomainRegexItem(expressions []string) (*DomainRegexItem, error)
func (*DomainRegexItem) Match ¶
func (r *DomainRegexItem) Match(metadata *adapter.InboundContext) bool
func (*DomainRegexItem) String ¶
func (r *DomainRegexItem) String() string
type GeoIPItem ¶
type GeoIPItem struct {
// contains filtered or unexported fields
}
func NewGeoIPItem ¶
type GeositeItem ¶
type GeositeItem struct {
// contains filtered or unexported fields
}
func NewGeositeItem ¶
func NewGeositeItem(router adapter.Router, logger log.ContextLogger, codes []string) *GeositeItem
func (*GeositeItem) Match ¶
func (r *GeositeItem) Match(metadata *adapter.InboundContext) bool
func (*GeositeItem) String ¶
func (r *GeositeItem) String() string
func (*GeositeItem) Update ¶
func (r *GeositeItem) Update() error
type IPCIDRItem ¶
type IPCIDRItem struct {
// contains filtered or unexported fields
}
func NewIPCIDRItem ¶
func NewIPCIDRItem(isSource bool, prefixStrings []string) (*IPCIDRItem, error)
func NewRawIPCIDRItem ¶
func NewRawIPCIDRItem(isSource bool, ipSet *netipx.IPSet) *IPCIDRItem
func (*IPCIDRItem) Match ¶
func (r *IPCIDRItem) Match(metadata *adapter.InboundContext) bool
func (*IPCIDRItem) String ¶
func (r *IPCIDRItem) String() string
type IPIsPrivateItem ¶
type IPIsPrivateItem struct {
// contains filtered or unexported fields
}
func NewIPIsPrivateItem ¶
func NewIPIsPrivateItem(isSource bool) *IPIsPrivateItem
func (*IPIsPrivateItem) Match ¶
func (r *IPIsPrivateItem) Match(metadata *adapter.InboundContext) bool
func (*IPIsPrivateItem) String ¶
func (r *IPIsPrivateItem) String() string
type IPVersionItem ¶
type IPVersionItem struct {
// contains filtered or unexported fields
}
func NewIPVersionItem ¶
func NewIPVersionItem(isIPv6 bool) *IPVersionItem
func (*IPVersionItem) Match ¶
func (r *IPVersionItem) Match(metadata *adapter.InboundContext) bool
func (*IPVersionItem) String ¶
func (r *IPVersionItem) String() string
type InboundItem ¶
type InboundItem struct {
// contains filtered or unexported fields
}
func NewInboundRule ¶
func NewInboundRule(inbounds []string) *InboundItem
func (*InboundItem) Match ¶
func (r *InboundItem) Match(metadata *adapter.InboundContext) bool
func (*InboundItem) String ¶
func (r *InboundItem) String() string
type LocalRuleSet ¶
type LocalRuleSet struct {
// contains filtered or unexported fields
}
func NewLocalRuleSet ¶
func (*LocalRuleSet) Cleanup ¶
func (s *LocalRuleSet) Cleanup()
func (*LocalRuleSet) Close ¶
func (s *LocalRuleSet) Close() error
func (*LocalRuleSet) DecRef ¶
func (s *LocalRuleSet) DecRef()
func (*LocalRuleSet) ExtractIPSet ¶
func (s *LocalRuleSet) ExtractIPSet() []*netipx.IPSet
func (*LocalRuleSet) IncRef ¶
func (s *LocalRuleSet) IncRef()
func (*LocalRuleSet) Match ¶
func (s *LocalRuleSet) Match(metadata *adapter.InboundContext) bool
func (*LocalRuleSet) Metadata ¶
func (s *LocalRuleSet) Metadata() adapter.RuleSetMetadata
func (*LocalRuleSet) Name ¶
func (s *LocalRuleSet) Name() string
func (*LocalRuleSet) PostStart ¶
func (s *LocalRuleSet) PostStart() error
func (*LocalRuleSet) RegisterCallback ¶
func (s *LocalRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
func (*LocalRuleSet) StartContext ¶
func (s *LocalRuleSet) StartContext(ctx context.Context, startContext *adapter.HTTPStartContext) error
func (*LocalRuleSet) String ¶
func (s *LocalRuleSet) String() string
func (*LocalRuleSet) UnregisterCallback ¶
func (s *LocalRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
type LogicalDNSRule ¶
type LogicalDNSRule struct {
// contains filtered or unexported fields
}
func NewLogicalDNSRule ¶
func NewLogicalDNSRule(ctx context.Context, logger log.ContextLogger, options option.LogicalDNSRule) (*LogicalDNSRule, error)
func (*LogicalDNSRule) Action ¶
func (r *LogicalDNSRule) Action() adapter.RuleAction
func (*LogicalDNSRule) Match ¶
func (r *LogicalDNSRule) Match(metadata *adapter.InboundContext) bool
func (*LogicalDNSRule) MatchAddressLimit ¶
func (r *LogicalDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
func (*LogicalDNSRule) UpdateGeosite ¶
func (r *LogicalDNSRule) UpdateGeosite() error
func (*LogicalDNSRule) WithAddressLimit ¶
func (r *LogicalDNSRule) WithAddressLimit() bool
type LogicalHeadlessRule ¶
type LogicalHeadlessRule struct {
// contains filtered or unexported fields
}
func NewLogicalHeadlessRule ¶
func NewLogicalHeadlessRule(ctx context.Context, options option.LogicalHeadlessRule) (*LogicalHeadlessRule, error)
func (*LogicalHeadlessRule) Action ¶
func (r *LogicalHeadlessRule) Action() adapter.RuleAction
func (*LogicalHeadlessRule) Match ¶
func (r *LogicalHeadlessRule) Match(metadata *adapter.InboundContext) bool
func (*LogicalHeadlessRule) UpdateGeosite ¶
func (r *LogicalHeadlessRule) UpdateGeosite() error
type LogicalRule ¶
type LogicalRule struct {
// contains filtered or unexported fields
}
func NewLogicalRule ¶
func NewLogicalRule(ctx context.Context, logger log.ContextLogger, options option.LogicalRule) (*LogicalRule, error)
func (*LogicalRule) Action ¶
func (r *LogicalRule) Action() adapter.RuleAction
func (*LogicalRule) Match ¶
func (r *LogicalRule) Match(metadata *adapter.InboundContext) bool
func (*LogicalRule) UpdateGeosite ¶
func (r *LogicalRule) UpdateGeosite() error
type NetworkIsConstrainedItem ¶
type NetworkIsConstrainedItem struct {
// contains filtered or unexported fields
}
func NewNetworkIsConstrainedItem ¶
func NewNetworkIsConstrainedItem(networkManager adapter.NetworkManager) *NetworkIsConstrainedItem
func (*NetworkIsConstrainedItem) Match ¶
func (r *NetworkIsConstrainedItem) Match(metadata *adapter.InboundContext) bool
func (*NetworkIsConstrainedItem) String ¶
func (r *NetworkIsConstrainedItem) String() string
type NetworkIsExpensiveItem ¶
type NetworkIsExpensiveItem struct {
// contains filtered or unexported fields
}
func NewNetworkIsExpensiveItem ¶
func NewNetworkIsExpensiveItem(networkManager adapter.NetworkManager) *NetworkIsExpensiveItem
func (*NetworkIsExpensiveItem) Match ¶
func (r *NetworkIsExpensiveItem) Match(metadata *adapter.InboundContext) bool
func (*NetworkIsExpensiveItem) String ¶
func (r *NetworkIsExpensiveItem) String() string
type NetworkItem ¶
type NetworkItem struct {
// contains filtered or unexported fields
}
func NewNetworkItem ¶
func NewNetworkItem(networks []string) *NetworkItem
func (*NetworkItem) Match ¶
func (r *NetworkItem) Match(metadata *adapter.InboundContext) bool
func (*NetworkItem) String ¶
func (r *NetworkItem) String() string
type NetworkTypeItem ¶
type NetworkTypeItem struct {
// contains filtered or unexported fields
}
func NewNetworkTypeItem ¶
func NewNetworkTypeItem(networkManager adapter.NetworkManager, networkType []C.InterfaceType) *NetworkTypeItem
func (*NetworkTypeItem) Match ¶
func (r *NetworkTypeItem) Match(metadata *adapter.InboundContext) bool
func (*NetworkTypeItem) String ¶
func (r *NetworkTypeItem) String() string
type OutboundItem ¶
type OutboundItem struct {
// contains filtered or unexported fields
}
func NewOutboundRule ¶
func NewOutboundRule(outbounds []string) *OutboundItem
func (*OutboundItem) Match ¶
func (r *OutboundItem) Match(metadata *adapter.InboundContext) bool
func (*OutboundItem) String ¶
func (r *OutboundItem) String() string
type PackageNameItem ¶
type PackageNameItem struct {
// contains filtered or unexported fields
}
func NewPackageNameItem ¶
func NewPackageNameItem(packageNameList []string) *PackageNameItem
func (*PackageNameItem) Match ¶
func (r *PackageNameItem) Match(metadata *adapter.InboundContext) bool
func (*PackageNameItem) String ¶
func (r *PackageNameItem) String() string
type PortItem ¶
type PortItem struct {
// contains filtered or unexported fields
}
func NewPortItem ¶
type PortRangeItem ¶
type PortRangeItem struct {
// contains filtered or unexported fields
}
func NewPortRangeItem ¶
func NewPortRangeItem(isSource bool, rangeList []string) (*PortRangeItem, error)
func (*PortRangeItem) Match ¶
func (r *PortRangeItem) Match(metadata *adapter.InboundContext) bool
func (*PortRangeItem) String ¶
func (r *PortRangeItem) String() string
type ProcessItem ¶
type ProcessItem struct {
// contains filtered or unexported fields
}
func NewProcessItem ¶
func NewProcessItem(processNameList []string) *ProcessItem
func (*ProcessItem) Match ¶
func (r *ProcessItem) Match(metadata *adapter.InboundContext) bool
func (*ProcessItem) String ¶
func (r *ProcessItem) String() string
type ProcessPathItem ¶
type ProcessPathItem struct {
// contains filtered or unexported fields
}
func NewProcessPathItem ¶
func NewProcessPathItem(processNameList []string) *ProcessPathItem
func (*ProcessPathItem) Match ¶
func (r *ProcessPathItem) Match(metadata *adapter.InboundContext) bool
func (*ProcessPathItem) String ¶
func (r *ProcessPathItem) String() string
type ProcessPathRegexItem ¶
type ProcessPathRegexItem struct {
// contains filtered or unexported fields
}
func NewProcessPathRegexItem ¶
func NewProcessPathRegexItem(expressions []string) (*ProcessPathRegexItem, error)
func (*ProcessPathRegexItem) Match ¶
func (r *ProcessPathRegexItem) Match(metadata *adapter.InboundContext) bool
func (*ProcessPathRegexItem) String ¶
func (r *ProcessPathRegexItem) String() string
type ProtocolItem ¶
type ProtocolItem struct {
// contains filtered or unexported fields
}
func NewProtocolItem ¶
func NewProtocolItem(protocols []string) *ProtocolItem
func (*ProtocolItem) Match ¶
func (r *ProtocolItem) Match(metadata *adapter.InboundContext) bool
func (*ProtocolItem) String ¶
func (r *ProtocolItem) String() string
type QueryTypeItem ¶
type QueryTypeItem struct {
// contains filtered or unexported fields
}
func NewQueryTypeItem ¶
func NewQueryTypeItem(typeList []option.DNSQueryType) *QueryTypeItem
func (*QueryTypeItem) Match ¶
func (r *QueryTypeItem) Match(metadata *adapter.InboundContext) bool
func (*QueryTypeItem) String ¶
func (r *QueryTypeItem) String() string
type RemoteRuleSet ¶
type RemoteRuleSet struct {
// contains filtered or unexported fields
}
func NewRemoteRuleSet ¶
func NewRemoteRuleSet(ctx context.Context, logger logger.ContextLogger, options option.RuleSet) *RemoteRuleSet
func (*RemoteRuleSet) Cleanup ¶
func (s *RemoteRuleSet) Cleanup()
func (*RemoteRuleSet) Close ¶
func (s *RemoteRuleSet) Close() error
func (*RemoteRuleSet) DecRef ¶
func (s *RemoteRuleSet) DecRef()
func (*RemoteRuleSet) ExtractIPSet ¶
func (s *RemoteRuleSet) ExtractIPSet() []*netipx.IPSet
func (*RemoteRuleSet) IncRef ¶
func (s *RemoteRuleSet) IncRef()
func (*RemoteRuleSet) Match ¶
func (s *RemoteRuleSet) Match(metadata *adapter.InboundContext) bool
func (*RemoteRuleSet) Metadata ¶
func (s *RemoteRuleSet) Metadata() adapter.RuleSetMetadata
func (*RemoteRuleSet) Name ¶
func (s *RemoteRuleSet) Name() string
func (*RemoteRuleSet) PostStart ¶
func (s *RemoteRuleSet) PostStart() error
func (*RemoteRuleSet) RegisterCallback ¶
func (s *RemoteRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
func (*RemoteRuleSet) StartContext ¶
func (s *RemoteRuleSet) StartContext(ctx context.Context, startContext *adapter.HTTPStartContext) error
func (*RemoteRuleSet) String ¶
func (s *RemoteRuleSet) String() string
func (*RemoteRuleSet) UnregisterCallback ¶
func (s *RemoteRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
type RuleActionDNSRoute ¶
type RuleActionDNSRoute struct { Server string RuleActionDNSRouteOptions }
func (*RuleActionDNSRoute) String ¶
func (r *RuleActionDNSRoute) String() string
func (*RuleActionDNSRoute) Type ¶
func (r *RuleActionDNSRoute) Type() string
type RuleActionDNSRouteOptions ¶
type RuleActionDNSRouteOptions struct { DisableCache bool RewriteTTL *uint32 ClientSubnet netip.Prefix }
func (*RuleActionDNSRouteOptions) String ¶
func (r *RuleActionDNSRouteOptions) String() string
func (*RuleActionDNSRouteOptions) Type ¶
func (r *RuleActionDNSRouteOptions) Type() string
type RuleActionDirect ¶
func (*RuleActionDirect) String ¶
func (r *RuleActionDirect) String() string
func (*RuleActionDirect) Type ¶
func (r *RuleActionDirect) Type() string
type RuleActionHijackDNS ¶
type RuleActionHijackDNS struct{}
func (*RuleActionHijackDNS) String ¶
func (r *RuleActionHijackDNS) String() string
func (*RuleActionHijackDNS) Type ¶
func (r *RuleActionHijackDNS) Type() string
type RuleActionReject ¶
type RuleActionReject struct { Method string NoDrop bool // contains filtered or unexported fields }
func (*RuleActionReject) String ¶
func (r *RuleActionReject) String() string
func (*RuleActionReject) Type ¶
func (r *RuleActionReject) Type() string
type RuleActionResolve ¶
type RuleActionResolve struct { Strategy dns.DomainStrategy Server string }
func (*RuleActionResolve) String ¶
func (r *RuleActionResolve) String() string
func (*RuleActionResolve) Type ¶
func (r *RuleActionResolve) Type() string
type RuleActionRoute ¶
type RuleActionRoute struct { Outbound string RuleActionRouteOptions }
func (*RuleActionRoute) String ¶
func (r *RuleActionRoute) String() string
func (*RuleActionRoute) Type ¶
func (r *RuleActionRoute) Type() string
type RuleActionRouteOptions ¶
type RuleActionRouteOptions struct { OverrideAddress M.Socksaddr OverridePort uint16 NetworkStrategy C.NetworkStrategy NetworkType []C.InterfaceType FallbackNetworkType []C.InterfaceType FallbackDelay time.Duration UDPDisableDomainUnmapping bool UDPConnect bool UDPTimeout time.Duration }
func (*RuleActionRouteOptions) String ¶
func (r *RuleActionRouteOptions) String() string
func (*RuleActionRouteOptions) Type ¶
func (r *RuleActionRouteOptions) Type() string
type RuleActionSniff ¶
type RuleActionSniff struct { StreamSniffers []sniff.StreamSniffer PacketSniffers []sniff.PacketSniffer Timeout time.Duration // Deprecated OverrideDestination bool // contains filtered or unexported fields }
func (*RuleActionSniff) String ¶
func (r *RuleActionSniff) String() string
func (*RuleActionSniff) Type ¶
func (r *RuleActionSniff) Type() string
type RuleItem ¶
type RuleItem interface { Match(metadata *adapter.InboundContext) bool String() string }
type RuleSetItem ¶
type RuleSetItem struct {
// contains filtered or unexported fields
}
func NewRuleSetItem ¶
func (*RuleSetItem) ContainsDestinationIPCIDRRule ¶
func (r *RuleSetItem) ContainsDestinationIPCIDRRule() bool
func (*RuleSetItem) Match ¶
func (r *RuleSetItem) Match(metadata *adapter.InboundContext) bool
func (*RuleSetItem) Start ¶
func (r *RuleSetItem) Start() error
func (*RuleSetItem) String ¶
func (r *RuleSetItem) String() string
type UserIdItem ¶
type UserIdItem struct {
// contains filtered or unexported fields
}
func NewUserIDItem ¶
func NewUserIDItem(userIdList []int32) *UserIdItem
func (*UserIdItem) Match ¶
func (r *UserIdItem) Match(metadata *adapter.InboundContext) bool
func (*UserIdItem) String ¶
func (r *UserIdItem) String() string
type UserItem ¶
type UserItem struct {
// contains filtered or unexported fields
}
func NewUserItem ¶
type WIFIBSSIDItem ¶
type WIFIBSSIDItem struct {
// contains filtered or unexported fields
}
func NewWIFIBSSIDItem ¶
func NewWIFIBSSIDItem(networkManager adapter.NetworkManager, bssidList []string) *WIFIBSSIDItem
func (*WIFIBSSIDItem) Match ¶
func (r *WIFIBSSIDItem) Match(metadata *adapter.InboundContext) bool
func (*WIFIBSSIDItem) String ¶
func (r *WIFIBSSIDItem) String() string
type WIFISSIDItem ¶
type WIFISSIDItem struct {
// contains filtered or unexported fields
}
func NewWIFISSIDItem ¶
func NewWIFISSIDItem(networkManager adapter.NetworkManager, ssidList []string) *WIFISSIDItem
func (*WIFISSIDItem) Match ¶
func (r *WIFISSIDItem) Match(metadata *adapter.InboundContext) bool
func (*WIFISSIDItem) String ¶
func (r *WIFISSIDItem) String() string
Source Files ¶
- rule_abstract.go
- rule_action.go
- rule_default.go
- rule_dns.go
- rule_headless.go
- rule_item_adguard.go
- rule_item_auth_user.go
- rule_item_cidr.go
- rule_item_clash_mode.go
- rule_item_client.go
- rule_item_domain.go
- rule_item_domain_keyword.go
- rule_item_domain_regex.go
- rule_item_geoip.go
- rule_item_geosite.go
- rule_item_inbound.go
- rule_item_ip_is_private.go
- rule_item_ipversion.go
- rule_item_network.go
- rule_item_network_is_constrained.go
- rule_item_network_is_expensive.go
- rule_item_network_type.go
- rule_item_outbound.go
- rule_item_package_name.go
- rule_item_port.go
- rule_item_port_range.go
- rule_item_process_name.go
- rule_item_process_path.go
- rule_item_process_path_regex.go
- rule_item_protocol.go
- rule_item_query_type.go
- rule_item_rule_set.go
- rule_item_user.go
- rule_item_user_id.go
- rule_item_wifi_bssid.go
- rule_item_wifi_ssid.go
- rule_set.go
- rule_set_local.go
- rule_set_remote.go
Click to show internal directories.
Click to hide internal directories.