test.pb.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: test.proto
  3. /*
  4. Package pb is a generated protocol buffer package.
  5. It is generated from these files:
  6. test.proto
  7. It has these top-level messages:
  8. Request
  9. Response
  10. */
  11. package pb
  12. import proto "github.com/golang/protobuf/proto"
  13. import fmt "fmt"
  14. import math "math"
  15. import (
  16. context "golang.org/x/net/context"
  17. grpc "google.golang.org/grpc"
  18. )
  19. // Reference imports to suppress errors if they are not otherwise used.
  20. var _ = proto.Marshal
  21. var _ = fmt.Errorf
  22. var _ = math.Inf
  23. // This is a compile-time assertion to ensure that this generated file
  24. // is compatible with the proto package it is being compiled against.
  25. // A compilation error at this line likely means your copy of the
  26. // proto package needs to be updated.
  27. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  28. type Request struct {
  29. Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
  30. }
  31. func (m *Request) Reset() { *m = Request{} }
  32. func (m *Request) String() string { return proto.CompactTextString(m) }
  33. func (*Request) ProtoMessage() {}
  34. func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  35. func (m *Request) GetMsg() string {
  36. if m != nil {
  37. return m.Msg
  38. }
  39. return ""
  40. }
  41. type Response struct {
  42. Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
  43. }
  44. func (m *Response) Reset() { *m = Response{} }
  45. func (m *Response) String() string { return proto.CompactTextString(m) }
  46. func (*Response) ProtoMessage() {}
  47. func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  48. func (m *Response) GetMsg() string {
  49. if m != nil {
  50. return m.Msg
  51. }
  52. return ""
  53. }
  54. func init() {
  55. proto.RegisterType((*Request)(nil), "pb.Request")
  56. proto.RegisterType((*Response)(nil), "pb.Response")
  57. }
  58. // Reference imports to suppress errors if they are not otherwise used.
  59. var _ context.Context
  60. var _ grpc.ClientConn
  61. // This is a compile-time assertion to ensure that this generated file
  62. // is compatible with the grpc package it is being compiled against.
  63. const _ = grpc.SupportPackageIsVersion4
  64. // Client API for Test service
  65. type TestClient interface {
  66. Test(ctx context.Context, opts ...grpc.CallOption) (Test_TestClient, error)
  67. }
  68. type testClient struct {
  69. cc *grpc.ClientConn
  70. }
  71. func NewTestClient(cc *grpc.ClientConn) TestClient {
  72. return &testClient{cc}
  73. }
  74. func (c *testClient) Test(ctx context.Context, opts ...grpc.CallOption) (Test_TestClient, error) {
  75. stream, err := grpc.NewClientStream(ctx, &_Test_serviceDesc.Streams[0], c.cc, "/pb.Test/Test", opts...)
  76. if err != nil {
  77. return nil, err
  78. }
  79. x := &testTestClient{stream}
  80. return x, nil
  81. }
  82. type Test_TestClient interface {
  83. Send(*Request) error
  84. Recv() (*Response, error)
  85. grpc.ClientStream
  86. }
  87. type testTestClient struct {
  88. grpc.ClientStream
  89. }
  90. func (x *testTestClient) Send(m *Request) error {
  91. return x.ClientStream.SendMsg(m)
  92. }
  93. func (x *testTestClient) Recv() (*Response, error) {
  94. m := new(Response)
  95. if err := x.ClientStream.RecvMsg(m); err != nil {
  96. return nil, err
  97. }
  98. return m, nil
  99. }
  100. // Server API for Test service
  101. type TestServer interface {
  102. Test(Test_TestServer) error
  103. }
  104. func RegisterTestServer(s *grpc.Server, srv TestServer) {
  105. s.RegisterService(&_Test_serviceDesc, srv)
  106. }
  107. func _Test_Test_Handler(srv interface{}, stream grpc.ServerStream) error {
  108. return srv.(TestServer).Test(&testTestServer{stream})
  109. }
  110. type Test_TestServer interface {
  111. Send(*Response) error
  112. Recv() (*Request, error)
  113. grpc.ServerStream
  114. }
  115. type testTestServer struct {
  116. grpc.ServerStream
  117. }
  118. func (x *testTestServer) Send(m *Response) error {
  119. return x.ServerStream.SendMsg(m)
  120. }
  121. func (x *testTestServer) Recv() (*Request, error) {
  122. m := new(Request)
  123. if err := x.ServerStream.RecvMsg(m); err != nil {
  124. return nil, err
  125. }
  126. return m, nil
  127. }
  128. var _Test_serviceDesc = grpc.ServiceDesc{
  129. ServiceName: "pb.Test",
  130. HandlerType: (*TestServer)(nil),
  131. Methods: []grpc.MethodDesc{},
  132. Streams: []grpc.StreamDesc{
  133. {
  134. StreamName: "Test",
  135. Handler: _Test_Test_Handler,
  136. ServerStreams: true,
  137. ClientStreams: true,
  138. },
  139. },
  140. Metadata: "test.proto",
  141. }
  142. func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
  143. var fileDescriptor0 = []byte{
  144. // 114 bytes of a gzipped FileDescriptorProto
  145. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2d, 0x2e,
  146. 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2a, 0x48, 0x52, 0x92, 0xe6, 0x62, 0x0f, 0x4a,
  147. 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x12, 0xe0, 0x62, 0xce, 0x2d, 0x4e, 0x97, 0x60, 0x54, 0x60,
  148. 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x95, 0x64, 0xb8, 0x38, 0x82, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a,
  149. 0x53, 0x31, 0x65, 0x8d, 0xf4, 0xb9, 0x58, 0x42, 0x40, 0xfa, 0xd4, 0xa1, 0x34, 0xb7, 0x5e, 0x41,
  150. 0x92, 0x1e, 0xd4, 0x30, 0x29, 0x1e, 0x08, 0x07, 0xa2, 0x59, 0x89, 0x41, 0x83, 0xd1, 0x80, 0x31,
  151. 0x89, 0x0d, 0x6c, 0xad, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x25, 0xc3, 0x70, 0x84, 0x00,
  152. 0x00, 0x00,
  153. }