WIP: draft for hash selector
See #66
Requires a big refactoring, see https://github.com/m13253/dns-over-https/pull/68/files#diff-545a0c1438740f4d2f9ab2f005ab9146R45
I think we can use the hash/fnv package of the Go standard library. It provides the Fowler–Noll–Vo hash function, which is a fast algorithm for hash table use.
I think the Selector.Get function can add a parameter to pass the requested domain name to the selector, so we can calculate the hash based on the requested domain name.
I think Get method can add a parameter that record the DNS request message, like who query, when, query for what. so that the selector has enough info to evaluate which upstream should be return. if selector doesn't care this info, just ignore it
I think Get method can add a parameter that record the DNS request message, [...] if selector doesn't care this info, just ignore it
Agree.