git » dnss » commit b79914b

Proto tidy up and name

author Alberto Bertogli
2015-09-06 22:21:12 UTC
committer Alberto Bertogli
2015-09-06 22:21:12 UTC
parent d9c8bd21d3f6bf06b517a5604ee3a822e9d6e6ef

Proto tidy up and name

dnss.go +0 -3
dnss.pb.go => proto/dnss.pb.go +2 -2
dnss.proto => proto/dnss.proto +2 -0
proto/dummy.go +4 -0

diff --git a/dnss.go b/dnss.go
index 9c30f84..33a6aa0 100644
--- a/dnss.go
+++ b/dnss.go
@@ -1,6 +1,3 @@
-// Generate the protobuf+grpc service.
-//go:generate protoc --go_out=plugins=grpc:. dnss.proto
-
 package main
 
 import (
diff --git a/dnss.pb.go b/proto/dnss.pb.go
similarity index 97%
rename from dnss.pb.go
rename to proto/dnss.pb.go
index 0ffc7ba..63b086a 100644
--- a/dnss.pb.go
+++ b/proto/dnss.pb.go
@@ -55,7 +55,7 @@ func NewDNSServiceClient(cc *grpc.ClientConn) DNSServiceClient {
 }
 
 func (c *dNSServiceClient) Query(ctx context.Context, opts ...grpc.CallOption) (DNSService_QueryClient, error) {
-	stream, err := grpc.NewClientStream(ctx, &_DNSService_serviceDesc.Streams[0], c.cc, "/.DNSService/Query", opts...)
+	stream, err := grpc.NewClientStream(ctx, &_DNSService_serviceDesc.Streams[0], c.cc, "/dnss.DNSService/Query", opts...)
 	if err != nil {
 		return nil, err
 	}
@@ -122,7 +122,7 @@ func (x *dNSServiceQueryServer) Recv() (*GobMsg, error) {
 }
 
 var _DNSService_serviceDesc = grpc.ServiceDesc{
-	ServiceName: ".DNSService",
+	ServiceName: "dnss.DNSService",
 	HandlerType: (*DNSServiceServer)(nil),
 	Methods:     []grpc.MethodDesc{},
 	Streams: []grpc.StreamDesc{
diff --git a/dnss.proto b/proto/dnss.proto
similarity index 93%
rename from dnss.proto
rename to proto/dnss.proto
index 92d204c..2bc0040 100644
--- a/dnss.proto
+++ b/proto/dnss.proto
@@ -1,6 +1,8 @@
 
 syntax = "proto3";
 
+package dnss;
+
 message GobMsg {
 	// gob-encoded message.
 	// A horrible hack, but will do for now.
diff --git a/proto/dummy.go b/proto/dummy.go
new file mode 100644
index 0000000..5136454
--- /dev/null
+++ b/proto/dummy.go
@@ -0,0 +1,4 @@
+package dnss
+
+// Generate the protobuf+grpc service.
+//go:generate protoc --go_out=plugins=grpc:. dnss.proto