rules

package
v1.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasNoResolve

func HasNoResolve(params []string) bool

func ParseRule

func ParseRule(tp, payload, target string, params []string) (C.Rule, error)

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

func (*Base) AppendGroup

func (b *Base) AppendGroup(group string)

func (*Base) RuleExtra

func (b *Base) RuleExtra() *C.RuleExtra

func (*Base) RuleGroups

func (b *Base) RuleGroups() C.RuleGroup

func (*Base) SetRuleExtra

func (b *Base) SetRuleExtra(re *C.RuleExtra)

func (*Base) ShouldFindProcess

func (b *Base) ShouldFindProcess() bool

func (*Base) SubRules

func (b *Base) SubRules() []C.Rule

type Domain

type Domain struct {
	*Base
	// contains filtered or unexported fields
}

func NewDomain

func NewDomain(domain string, adapter string) *Domain

func (*Domain) Adapter

func (d *Domain) Adapter() string

func (*Domain) Match

func (d *Domain) Match(metadata *C.Metadata) bool

func (*Domain) Payload

func (d *Domain) Payload() string

func (*Domain) RuleType

func (d *Domain) RuleType() C.RuleType

func (*Domain) ShouldResolveIP

func (d *Domain) ShouldResolveIP() bool

type DomainKeyword

type DomainKeyword struct {
	*Base
	// contains filtered or unexported fields
}

func NewDomainKeyword

func NewDomainKeyword(keyword string, adapter string) *DomainKeyword

func (*DomainKeyword) Adapter

func (dk *DomainKeyword) Adapter() string

func (*DomainKeyword) Match

func (dk *DomainKeyword) Match(metadata *C.Metadata) bool

func (*DomainKeyword) Payload

func (dk *DomainKeyword) Payload() string

func (*DomainKeyword) RuleType

func (dk *DomainKeyword) RuleType() C.RuleType

func (*DomainKeyword) ShouldResolveIP

func (dk *DomainKeyword) ShouldResolveIP() bool

type DomainSuffix

type DomainSuffix struct {
	*Base
	// contains filtered or unexported fields
}

func NewDomainSuffix

func NewDomainSuffix(suffix string, adapter string) *DomainSuffix

func (*DomainSuffix) Adapter

func (ds *DomainSuffix) Adapter() string

func (*DomainSuffix) Match

func (ds *DomainSuffix) Match(metadata *C.Metadata) bool

func (*DomainSuffix) Payload

func (ds *DomainSuffix) Payload() string

func (*DomainSuffix) RuleType

func (ds *DomainSuffix) RuleType() C.RuleType

func (*DomainSuffix) ShouldResolveIP

func (ds *DomainSuffix) ShouldResolveIP() bool

type GEOIP

type GEOIP struct {
	*Base
	// contains filtered or unexported fields
}

func NewGEOIP

func NewGEOIP(country string, adapter string, noResolveIP bool) *GEOIP

func (*GEOIP) Adapter

func (g *GEOIP) Adapter() string

func (*GEOIP) GetCountry

func (g *GEOIP) GetCountry() string

func (*GEOIP) Match

func (g *GEOIP) Match(metadata *C.Metadata) bool

func (*GEOIP) Payload

func (g *GEOIP) Payload() string

func (*GEOIP) RuleType

func (g *GEOIP) RuleType() C.RuleType

func (*GEOIP) ShouldResolveIP

func (g *GEOIP) ShouldResolveIP() bool

type GEOSITE

type GEOSITE struct {
	*Base
	// contains filtered or unexported fields
}

func NewGEOSITE

func NewGEOSITE(country string, adapter string) (*GEOSITE, error)

func (*GEOSITE) Adapter

func (gs *GEOSITE) Adapter() string

func (*GEOSITE) GetDomainMatcher

func (gs *GEOSITE) GetDomainMatcher() *router.DomainMatcher

func (*GEOSITE) Match

func (gs *GEOSITE) Match(metadata *C.Metadata) bool

func (*GEOSITE) Payload

func (gs *GEOSITE) Payload() string

func (*GEOSITE) RuleType

func (gs *GEOSITE) RuleType() C.RuleType

func (*GEOSITE) ShouldResolveIP

func (gs *GEOSITE) ShouldResolveIP() bool

type Group

type Group struct {
	*Base
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(payload string, matcher C.Matcher, rules []C.Rule) *Group

func (*Group) Adapter

func (g *Group) Adapter() string

func (*Group) Match

func (g *Group) Match(metadata *C.Metadata) bool

func (*Group) Payload

func (g *Group) Payload() string

func (*Group) RuleExtra

func (g *Group) RuleExtra() *C.RuleExtra

func (*Group) RuleType

func (g *Group) RuleType() C.RuleType

func (*Group) ShouldResolveIP

func (g *Group) ShouldResolveIP() bool

func (*Group) SubRules

func (g *Group) SubRules() []C.Rule

type IPCIDR

type IPCIDR struct {
	*Base
	// contains filtered or unexported fields
}

func NewIPCIDR

func NewIPCIDR(s string, adapter string, opts ...IPCIDROption) (*IPCIDR, error)

func (*IPCIDR) Adapter

func (i *IPCIDR) Adapter() string

func (*IPCIDR) Match

func (i *IPCIDR) Match(metadata *C.Metadata) bool

func (*IPCIDR) Payload

func (i *IPCIDR) Payload() string

func (*IPCIDR) RuleType

func (i *IPCIDR) RuleType() C.RuleType

func (*IPCIDR) ShouldResolveIP

func (i *IPCIDR) ShouldResolveIP() bool

type IPCIDROption

type IPCIDROption func(*IPCIDR)

func WithIPCIDRNoResolve

func WithIPCIDRNoResolve(noResolve bool) IPCIDROption

func WithIPCIDRSourceIP

func WithIPCIDRSourceIP(b bool) IPCIDROption

type IPSet

type IPSet struct {
	*Base
	// contains filtered or unexported fields
}

func NewIPSet

func NewIPSet(name string, adapter string, noResolveIP bool) (*IPSet, error)

func (*IPSet) Adapter

func (f *IPSet) Adapter() string

func (*IPSet) Match

func (f *IPSet) Match(metadata *C.Metadata) bool

func (*IPSet) Payload

func (f *IPSet) Payload() string

func (*IPSet) RuleType

func (f *IPSet) RuleType() C.RuleType

func (*IPSet) ShouldResolveIP

func (f *IPSet) ShouldResolveIP() bool

type Match

type Match struct {
	*Base
	// contains filtered or unexported fields
}

func NewMatch

func NewMatch(adapter string) *Match

func (*Match) Adapter

func (f *Match) Adapter() string

func (*Match) Match

func (f *Match) Match(metadata *C.Metadata) bool

func (*Match) Payload

func (f *Match) Payload() string

func (*Match) RuleType

func (f *Match) RuleType() C.RuleType

func (*Match) ShouldResolveIP

func (f *Match) ShouldResolveIP() bool

type Port

type Port struct {
	*Base
	// contains filtered or unexported fields
}

func NewPort

func NewPort(port string, adapter string, portType PortType) (*Port, error)

func (*Port) Adapter

func (p *Port) Adapter() string

func (*Port) Match

func (p *Port) Match(metadata *C.Metadata) bool

func (*Port) Payload

func (p *Port) Payload() string

func (*Port) RuleType

func (p *Port) RuleType() C.RuleType

func (*Port) ShouldResolveIP

func (p *Port) ShouldResolveIP() bool

type PortType

type PortType int
const (
	PortTypeSrc PortType = iota
	PortTypeDest
	PortTypeInbound
)

type Process

type Process struct {
	*Base
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(process string, adapter string, nameOnly bool) (*Process, error)

func (*Process) Adapter

func (ps *Process) Adapter() string

func (*Process) Match

func (ps *Process) Match(metadata *C.Metadata) bool

func (*Process) Payload

func (ps *Process) Payload() string

func (*Process) RuleType

func (ps *Process) RuleType() C.RuleType

func (*Process) ShouldFindProcess

func (ps *Process) ShouldFindProcess() bool

func (*Process) ShouldResolveIP

func (ps *Process) ShouldResolveIP() bool

type Script

type Script struct {
	*Base
	// contains filtered or unexported fields
}

func NewScript

func NewScript(shortcut string, adapter string) (*Script, error)

func (*Script) Adapter

func (s *Script) Adapter() string

func (*Script) Match

func (s *Script) Match(metadata *C.Metadata) bool

func (*Script) Payload

func (s *Script) Payload() string

func (*Script) RuleExtra

func (s *Script) RuleExtra() *C.RuleExtra

func (*Script) RuleType

func (s *Script) RuleType() C.RuleType

func (*Script) SetMatcher

func (s *Script) SetMatcher(m C.Matcher)

func (*Script) ShouldResolveIP

func (s *Script) ShouldResolveIP() bool

type UserAgent

type UserAgent struct {
	*Base
	// contains filtered or unexported fields
}

func NewUserAgent

func NewUserAgent(ua string, adapter string) (*UserAgent, error)

func (*UserAgent) Adapter

func (d *UserAgent) Adapter() string

func (*UserAgent) Match

func (d *UserAgent) Match(metadata *C.Metadata) bool

func (*UserAgent) Payload

func (d *UserAgent) Payload() string

func (*UserAgent) RuleType

func (d *UserAgent) RuleType() C.RuleType

func (*UserAgent) ShouldResolveIP

func (d *UserAgent) ShouldResolveIP() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL