domains

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2016 License: MIT 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 = iota //基本匹配,必须完全一致才匹配
	Suffix                   // 后缀匹配 , abc.com 匹配 www.abc.com 、123.abc.com、123.456.abc.com 及 abc.com
	Pan                      // 泛解析 ,处理 * 及 ?
	Regex                    //正则,正则表达式
)

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

追加新的域名

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 时表示需要删除

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

func (*Domains) RemoveType added in v0.4.4

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

移除域名 使用过滤函数来识别需要删除的内容,返回 true 时表示需要删除

type UserData

type UserData interface{}

Jump to

Keyboard shortcuts

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