Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenAllMatchDomain ¶
GenAllMatchDomain 生成能够与目标域名匹配的所有解析域名的翻转格式 如 "a.b.example.com" -> ["com.example.b.a", "com.example.b.a.*", "com.example.b.*", "com.example.*"]
func ReverseDomain ¶
ReverseDomain 翻转域名 如'a.example.com' -> 'com.example.a'
func ReverseDomainAndToSlice ¶
ReverseDomainAndToSlice 翻转域名并解析为切片 目前已知多后缀域名只有一个"com.cn",所以处理该类型的域名时会将"com.cn"看为一个整体 如'a.example.com' -> ["com", "example", "a"] 如'a.example.com.cn' -> ["com.cn", "example", "a"]
func SliceDeduplication ¶
func SliceDeduplication[T comparable](ts []T) []T
SliceDeduplication 对切片元素进行去重,但是需要确保切片是可比较的
func SliceRemoveItem ¶
SliceRemoveItem 删除切片中指定位置的元素,相比于常用的 `s = append(s[:i], s[i+1:]...)` 具有更高的效率
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.