Add TLS resolver connection reusing and pooling

Also, fix caching issues and add more tests
This commit is contained in:
Daniel
2020-05-15 22:43:06 +02:00
parent dd837e40e2
commit 53eb309e72
11 changed files with 510 additions and 61 deletions

View File

@@ -0,0 +1,27 @@
package resolver
import "testing"
func TestNameRecordStorage(t *testing.T) {
testDomain := "Mk35mMqOWEHXSMk11MYcbjLOjTE8PQvDiAVUxf4BvwtgR.example.com."
testQuestion := "A"
testNameRecord := &NameRecord{
Domain: testDomain,
Question: testQuestion,
}
err := testNameRecord.Save()
if err != nil {
t.Fatal(err)
}
r, err := GetNameRecord(testDomain, testQuestion)
if err != nil {
t.Fatal(err)
}
if r.Domain != testDomain || r.Question != testQuestion {
t.Fatal("mismatch")
}
}