Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidDomain = errors.New("invalid domain")
ErrInvalidDomain means insert domain is invalid
Functions ¶
func ValidAndSplitDomain ¶
Types ¶
type DomainTrie ¶
type DomainTrie struct {
// contains filtered or unexported fields
}
DomainTrie contains the main logic for adding and searching nodes for domain segments. support wildcard domain (e.g *.google.com)
func (*DomainTrie) Insert ¶
func (t *DomainTrie) Insert(domain string, data any) error
Insert adds a node to the trie. Support 1. www.example.com 2. *.example.com 3. subdomain.*.example.com 4. .example.com 5. +.example.com
func (*DomainTrie) Search ¶
func (t *DomainTrie) Search(domain string) *Node
Search is the most important part of the Trie. Priority as: 1. static part 2. wildcard domain 2. dot wildcard domain
Click to show internal directories.
Click to hide internal directories.