rules

package
v0.0.0-...-ae8e054 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

@Time : 2021/3/9 4:07 PM @Author : charley @File : Address

@Time : 2021/3/9 4:26 PM @Author : charley @File : address_keyword

@Time : 2021/3/9 4:26 PM @Author : charley @File : address_suffix

@Time : 2021/3/9 4:05 PM @Author : charley @File : domain

@Time : 2021/3/9 4:06 PM @Author : charley @File : domain_keyword

@Time : 2021/3/9 3:57 PM @Author : charley @File : domain_suffix

@Time : 2021/3/9 5:30 PM @Author : charley @File : parser

@Time : 2021/3/9 4:51 PM @Author : charley @File : rules_group

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseClashRule

func ParseClashRule(ruleLine string, remoteDnsServer constant.RemoteDnsServer) (constant.Rule, error)

func ParseDnsmasqRule

func ParseDnsmasqRule(ruleLine string, remoteDnsServer constant.RemoteDnsServer) (constant.Rule, error)

func ParseRule

func ParseRule(ruleLine string, remoteDnsServers map[string]constant.RemoteDnsServer) (constant.Rule, error)

Types

type Address

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

func NewAddress

func NewAddress(domain string, remoteServer constant.RemoteDnsServer) *Address

func (*Address) Match

func (addr *Address) Match(msg *dns.Msg) bool

func (*Address) Payload

func (addr *Address) Payload() string

func (*Address) RemoteServer

func (addr *Address) RemoteServer() constant.RemoteDnsServer

func (*Address) RuleType

func (addr *Address) RuleType() constant.RuleType

type AddressKeyword

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

func NewAddressKeyword

func NewAddressKeyword(keyword string, remoteServer constant.RemoteDnsServer) *AddressKeyword

func (*AddressKeyword) Match

func (ak *AddressKeyword) Match(msg *dns.Msg) bool

func (*AddressKeyword) Payload

func (ak *AddressKeyword) Payload() string

func (*AddressKeyword) RemoteServer

func (ak *AddressKeyword) RemoteServer() constant.RemoteDnsServer

func (*AddressKeyword) RuleType

func (ak *AddressKeyword) RuleType() constant.RuleType

type AddressSuffix

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

func NewAddressSuffix

func NewAddressSuffix(suffix string, remoteServer constant.RemoteDnsServer) *AddressSuffix

func (*AddressSuffix) Match

func (as *AddressSuffix) Match(msg *dns.Msg) bool

func (*AddressSuffix) Payload

func (as *AddressSuffix) Payload() string

func (*AddressSuffix) RemoteServer

func (as *AddressSuffix) RemoteServer() constant.RemoteDnsServer

func (*AddressSuffix) RuleType

func (as *AddressSuffix) RuleType() constant.RuleType

type Domain

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

func NewDomain

func NewDomain(domain string, remoteServer constant.RemoteDnsServer) *Domain

func (*Domain) Match

func (d *Domain) Match(msg *dns.Msg) bool

func (*Domain) Payload

func (d *Domain) Payload() string

func (*Domain) RemoteServer

func (d *Domain) RemoteServer() constant.RemoteDnsServer

func (*Domain) RuleType

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

type DomainKeyword

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

func NewDomainKeyword

func NewDomainKeyword(keyword string, remoteServer constant.RemoteDnsServer) *DomainKeyword

func (*DomainKeyword) Match

func (dk *DomainKeyword) Match(msg *dns.Msg) bool

func (*DomainKeyword) Payload

func (dk *DomainKeyword) Payload() string

func (*DomainKeyword) RemoteServer

func (dk *DomainKeyword) RemoteServer() constant.RemoteDnsServer

func (*DomainKeyword) ResultIPAddress

func (dk *DomainKeyword) ResultIPAddress() string

func (*DomainKeyword) RuleType

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

type DomainSuffix

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

func NewDomainSuffix

func NewDomainSuffix(suffix string, remoteServer constant.RemoteDnsServer) *DomainSuffix

func (*DomainSuffix) Match

func (ds *DomainSuffix) Match(msg *dns.Msg) bool

func (*DomainSuffix) Payload

func (ds *DomainSuffix) Payload() string

func (*DomainSuffix) RemoteServer

func (ds *DomainSuffix) RemoteServer() constant.RemoteDnsServer

func (*DomainSuffix) RuleType

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

type RuleList

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

func NewRuleList

func NewRuleList(name string, rules []constant.Rule) *RuleList

func (*RuleList) AddressRules

func (rl *RuleList) AddressRules() []constant.Rule

func (*RuleList) Match

func (rl *RuleList) Match(msg *dns.Msg) (constant.Rule, error)

func (*RuleList) Name

func (rl *RuleList) Name() string

func (*RuleList) Rules

func (rl *RuleList) Rules() []constant.Rule

func (*RuleList) ServerRules

func (rl *RuleList) ServerRules() []constant.Rule

Jump to

Keyboard shortcuts

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