git » dnss » commit 313bcf2

Rename "dnstogrpc" to "dnstox"

author Alberto Bertogli
2016-05-17 19:13:48 UTC
committer Alberto Bertogli
2016-05-18 23:08:48 UTC
parent 42c5cf92820a1845138d4e1448f6f5f135d3fb31

Rename "dnstogrpc" to "dnstox"

In upcoming patches, we're going to add a new protocol, so rename "dnstogrpc"
to "dnstox" in preparation.

dnss.go +4 -4
dnss_test.go +4 -4
dnstogrpc/dnstogrpc.go => dnstox/dnstox.go +2 -2
{dnstogrpc => dnstox}/resolver.go +4 -4

diff --git a/dnss.go b/dnss.go
index ea6b659..54c4c0d 100644
--- a/dnss.go
+++ b/dnss.go
@@ -15,7 +15,7 @@ import (
 	"google.golang.org/grpc"
 	_ "google.golang.org/grpc/grpclog/glogger"
 
-	"blitiri.com.ar/go/dnss/dnstogrpc"
+	"blitiri.com.ar/go/dnss/dnstox"
 	"blitiri.com.ar/go/dnss/grpctodns"
 )
 
@@ -80,9 +80,9 @@ func main() {
 
 	// DNS to GRPC.
 	if *enableDNStoGRPC {
-		r := dnstogrpc.NewGRPCResolver(*grpcUpstream, *grpcClientCAFile)
-		cr := dnstogrpc.NewCachingResolver(r)
-		dtg := dnstogrpc.New(*dnsListenAddr, cr, *dnsUnqualifiedUpstream)
+		r := dnstox.NewGRPCResolver(*grpcUpstream, *grpcClientCAFile)
+		cr := dnstox.NewCachingResolver(r)
+		dtg := dnstox.New(*dnsListenAddr, cr, *dnsUnqualifiedUpstream)
 		wg.Add(1)
 		go func() {
 			defer wg.Done()
diff --git a/dnss_test.go b/dnss_test.go
index 391294e..2c37448 100644
--- a/dnss_test.go
+++ b/dnss_test.go
@@ -19,7 +19,7 @@ import (
 	"github.com/golang/glog"
 	"github.com/miekg/dns"
 
-	"blitiri.com.ar/go/dnss/dnstogrpc"
+	"blitiri.com.ar/go/dnss/dnstox"
 	"blitiri.com.ar/go/dnss/grpctodns"
 )
 
@@ -230,9 +230,9 @@ func realMain(m *testing.M) int {
 	}
 
 	// DNS to GRPC server.
-	gr := dnstogrpc.NewGRPCResolver(grpcToDnsAddr, tmpDir+"/cert.pem")
-	cr := dnstogrpc.NewCachingResolver(gr)
-	dtg := dnstogrpc.New(dnsToGrpcAddr, cr, "")
+	gr := dnstox.NewGRPCResolver(grpcToDnsAddr, tmpDir+"/cert.pem")
+	cr := dnstox.NewCachingResolver(gr)
+	dtg := dnstox.New(dnsToGrpcAddr, cr, "")
 	go dtg.ListenAndServe()
 
 	// GRPC to DNS server.
diff --git a/dnstogrpc/dnstogrpc.go b/dnstox/dnstox.go
similarity index 98%
rename from dnstogrpc/dnstogrpc.go
rename to dnstox/dnstox.go
index 0180568..fb5f073 100644
--- a/dnstogrpc/dnstogrpc.go
+++ b/dnstox/dnstox.go
@@ -1,6 +1,6 @@
 // DNS to GRPC.
 
-package dnstogrpc
+package dnstox
 
 import (
 	"crypto/rand"
@@ -58,7 +58,7 @@ func New(addr string, resolver Resolver, unqUpstream string) *Server {
 }
 
 func (s *Server) Handler(w dns.ResponseWriter, r *dns.Msg) {
-	tr := trace.New("dnstogrpc", "Handler")
+	tr := trace.New("dnstox", "Handler")
 	defer tr.Finish()
 
 	tr.LazyPrintf("from:%v   id:%v", w.RemoteAddr(), r.Id)
diff --git a/dnstogrpc/resolver.go b/dnstox/resolver.go
similarity index 97%
rename from dnstogrpc/resolver.go
rename to dnstox/resolver.go
index 656a1f6..2c8c6dd 100644
--- a/dnstogrpc/resolver.go
+++ b/dnstox/resolver.go
@@ -1,4 +1,4 @@
-package dnstogrpc
+package dnstox
 
 import (
 	"expvar"
@@ -169,8 +169,8 @@ func (c *cachingResolver) Init() error {
 	// We register the debug handlers.
 	// Note these are global by nature, if you create more than once resolver,
 	// the last one will prevail.
-	http.HandleFunc("/debug/dnstogrpc/cache/dump", c.DumpCache)
-	http.HandleFunc("/debug/dnstogrpc/cache/flush", c.FlushCache)
+	http.HandleFunc("/debug/dnstox/cache/dump", c.DumpCache)
+	http.HandleFunc("/debug/dnstox/cache/flush", c.FlushCache)
 	return nil
 }
 
@@ -223,7 +223,7 @@ func (c *cachingResolver) Maintain() {
 	go c.back.Maintain()
 
 	for now := range time.Tick(maintenancePeriod) {
-		tr := trace.New("dnstogrpc.Cache", "GC")
+		tr := trace.New("dnstox.Cache", "GC")
 		var total, expired int
 
 		c.mu.Lock()