Refactor: lrucache use generics

This commit is contained in:
yaling888
2022-04-05 20:23:16 +08:00
parent 92d9d03f99
commit 0582c608b3
8 changed files with 106 additions and 97 deletions

View File

@@ -63,7 +63,7 @@ func withHosts(hosts *trie.DomainTrie) middleware {
}
}
func withMapping(mapping *cache.LruCache) middleware {
func withMapping(mapping *cache.LruCache[string, string]) middleware {
return func(next handler) handler {
return func(ctx *context.DNSContext, r *D.Msg) (*D.Msg, error) {
q := r.Question[0]