Documentation
¶
Index ¶
- Variables
- func ConvertMain(args []string)
- func ConvertToMrs(buf []byte, behavior P.RuleBehavior, format P.RuleFormat, w io.Writer) (err error)
- func NewClassicalStrategy(...) *classicalStrategy
- func NewDomainStrategy() *domainStrategy
- func NewIPCidrStrategy() *ipcidrStrategy
- func NewInlineProvider(name string, behavior P.RuleBehavior, payload []string, ...) P.RuleProvider
- func NewRuleSetProvider(name string, behavior P.RuleBehavior, format P.RuleFormat, ...) P.RuleProvider
- func ParseRuleProvider(name string, mapping map[string]any, parse common.ParseRuleFunc) (P.RuleProvider, error)
- func SetTunnel(t P.Tunnel)
- type InlineProvider
- type RulePayload
- type RuleSet
- func (rs *RuleSet) Adapter() string
- func (rs *RuleSet) Match(metadata *C.Metadata) (bool, string)
- func (rs *RuleSet) MatchDomain(domain string) bool
- func (rs *RuleSet) MatchIp(ip netip.Addr) bool
- func (rs *RuleSet) Payload() string
- func (rs *RuleSet) ProviderNames() []string
- func (rs *RuleSet) RuleType() C.RuleType
- func (rs *RuleSet) ShouldFindProcess() bool
- func (rs *RuleSet) ShouldResolveIP() bool
- type RuleSetProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPayload = errors.New("file must have a `payload` field") ErrInvalidFormat = errors.New("invalid format") )
View Source
var MrsMagicBytes = [4]byte{'M', 'R', 'S', 1} // MRSv1
Functions ¶
func ConvertMain ¶ added in v1.18.7
func ConvertMain(args []string)
func ConvertToMrs ¶ added in v1.18.7
func ConvertToMrs(buf []byte, behavior P.RuleBehavior, format P.RuleFormat, w io.Writer) (err error)
func NewClassicalStrategy ¶
func NewDomainStrategy ¶
func NewDomainStrategy() *domainStrategy
func NewIPCidrStrategy ¶
func NewIPCidrStrategy() *ipcidrStrategy
func NewInlineProvider ¶ added in v1.19.1
func NewInlineProvider(name string, behavior P.RuleBehavior, payload []string, parse common.ParseRuleFunc) P.RuleProvider
func NewRuleSetProvider ¶
func NewRuleSetProvider(name string, behavior P.RuleBehavior, format P.RuleFormat, interval time.Duration, vehicle P.Vehicle, parse common.ParseRuleFunc) P.RuleProvider
func ParseRuleProvider ¶
func ParseRuleProvider(name string, mapping map[string]any, parse common.ParseRuleFunc) (P.RuleProvider, error)
Types ¶
type InlineProvider ¶ added in v1.19.1
type InlineProvider struct {
// contains filtered or unexported fields
}
func (InlineProvider) MarshalJSON ¶ added in v1.19.1
func (InlineProvider) VehicleType ¶ added in v1.19.1
func (i InlineProvider) VehicleType() P.VehicleType
type RulePayload ¶
type RuleSet ¶
func NewRuleSet ¶
func (*RuleSet) MatchDomain ¶ added in v1.18.8
MatchDomain implements C.DomainMatcher
func (*RuleSet) ProviderNames ¶ added in v1.18.6
func (*RuleSet) ShouldFindProcess ¶
func (*RuleSet) ShouldResolveIP ¶
type RuleSetProvider ¶
type RuleSetProvider struct {
// contains filtered or unexported fields
}
func (*RuleSetProvider) Close ¶ added in v1.18.8
func (rp *RuleSetProvider) Close() error
func (RuleSetProvider) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.