domains

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Userdatas []UserData
}

对外单个域名 外部程序不要修改值。

type DomainType

type DomainType int
const (
	Base   DomainType = 1 + iota //基本匹配,必须完全一致才匹配
	Suffix                       // 后缀匹配 , abc.com 匹配 www.abc.com 、123.abc.com、123.456.abc.com 及 abc.com
	Pan                          // 泛解析 ,处理 * 及 ?
	Regex                        //正则,正则表达式
)

func ParseDomainType added in v0.5.0

func ParseDomainType(v string) (DomainType, error)

func (*DomainType) String added in v0.5.0

func (t *DomainType) String() string

type Domains added in v0.4.4

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

func NewDomains

func NewDomains(cacheSize int) *Domains

func (*Domains) Add added in v0.4.4

func (d *Domains) Add(domain string, domainType DomainType, userdata UserData) error

追加新的域名 Find 时的域名也会被转换成为小写进行匹配。 Add 添加的 基本、后缀、泛解析的域名会被转换成为小写格式。 正则表达式由于可能存在语义,不会自动转换成为小写,需要写正则表达式时注意使用小写域名。

func (*Domains) Find added in v0.4.4

func (d *Domains) Find(domain string) *Domain

查找匹配的域名 会转换成小写去匹配

func (*Domains) Remove added in v0.4.4

func (d *Domains) Remove(f func(domain string, domainType DomainType, uesrdata UserData) bool)

移除域名 使用过滤函数来识别需要删除的内容,返回 true 时表示需要删除 基本、后缀、泛解析的域名会被转换成为小写格式,f 函数处理时需要注意。

func (*Domains) RemoveDomain added in v0.4.4

func (d *Domains) RemoveDomain(domain string, domainType DomainType, f func(domain string, domainType DomainType, uesrdata UserData) bool) error

基本、后缀、泛解析的域名会被转换成为小写格式,f 函数处理时需要注意。

func (*Domains) RemoveType added in v0.4.4

func (d *Domains) RemoveType(domainType DomainType, f func(domain string, domainType DomainType, uesrdata UserData) bool)

移除域名 使用过滤函数来识别需要删除的内容,返回 true 时表示需要删除 基本、后缀、泛解析的域名会被转换成为小写格式,f 函数处理时需要注意。

type UserData

type UserData interface{}

Jump to

Keyboard shortcuts

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