Refactor: DomainTrie use generics

This commit is contained in:
yaling888
2022-04-06 04:25:53 +08:00
committed by Meta
parent 0c65f6962a
commit a6eb11ce18
10 changed files with 100 additions and 68 deletions

View File

@ -28,7 +28,7 @@ type Pool struct {
broadcast uint32
offset uint32
mux sync.Mutex
host *trie.DomainTrie
host *trie.DomainTrie[bool]
ipnet *net.IPNet
store store
}
@ -138,7 +138,7 @@ func uintToIP(v uint32) net.IP {
type Options struct {
IPNet *net.IPNet
Host *trie.DomainTrie
Host *trie.DomainTrie[bool]
// Size sets the maximum number of entries in memory
// and does not work if Persistence is true