Skip to content

Commit

Permalink
Rename "dnstogrpc" to "dnstox"
Browse files Browse the repository at this point in the history
In upcoming patches, we're going to add a new protocol, so rename "dnstogrpc"
to "dnstox" in preparation.
  • Loading branch information
albertito committed May 18, 2016
1 parent 42c5cf9 commit 313bcf2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions dnss.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions dnss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions dnstogrpc/dnstogrpc.go → dnstox/dnstox.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// DNS to GRPC.

package dnstogrpc
package dnstox

import (
"crypto/rand"
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions dnstogrpc/resolver.go → dnstox/resolver.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dnstogrpc
package dnstox

import (
"expvar"
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 313bcf2

Please sign in to comment.