test.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. // Code generated by protoc-gen-go.
  2. // source: test.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package mwitkow_testproto is a generated protocol buffer package.
  6. It is generated from these files:
  7. test.proto
  8. It has these top-level messages:
  9. Empty
  10. PingRequest
  11. PingResponse
  12. */
  13. package mwitkow_testproto
  14. import proto "github.com/golang/protobuf/proto"
  15. import fmt "fmt"
  16. import math "math"
  17. import (
  18. context "golang.org/x/net/context"
  19. grpc "google.golang.org/grpc"
  20. )
  21. // Reference imports to suppress errors if they are not otherwise used.
  22. var _ = proto.Marshal
  23. var _ = fmt.Errorf
  24. var _ = math.Inf
  25. // This is a compile-time assertion to ensure that this generated file
  26. // is compatible with the proto package it is being compiled against.
  27. // A compilation error at this line likely means your copy of the
  28. // proto package needs to be updated.
  29. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  30. type Empty struct {
  31. }
  32. func (m *Empty) Reset() { *m = Empty{} }
  33. func (m *Empty) String() string { return proto.CompactTextString(m) }
  34. func (*Empty) ProtoMessage() {}
  35. func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  36. type PingRequest struct {
  37. Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
  38. SleepTimeMs int32 `protobuf:"varint,2,opt,name=sleep_time_ms,json=sleepTimeMs" json:"sleep_time_ms,omitempty"`
  39. ErrorCodeReturned uint32 `protobuf:"varint,3,opt,name=error_code_returned,json=errorCodeReturned" json:"error_code_returned,omitempty"`
  40. }
  41. func (m *PingRequest) Reset() { *m = PingRequest{} }
  42. func (m *PingRequest) String() string { return proto.CompactTextString(m) }
  43. func (*PingRequest) ProtoMessage() {}
  44. func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  45. type PingResponse struct {
  46. Value string `protobuf:"bytes,1,opt,name=Value,json=value" json:"Value,omitempty"`
  47. Counter int32 `protobuf:"varint,2,opt,name=counter" json:"counter,omitempty"`
  48. }
  49. func (m *PingResponse) Reset() { *m = PingResponse{} }
  50. func (m *PingResponse) String() string { return proto.CompactTextString(m) }
  51. func (*PingResponse) ProtoMessage() {}
  52. func (*PingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
  53. func init() {
  54. proto.RegisterType((*Empty)(nil), "mwitkow.testproto.Empty")
  55. proto.RegisterType((*PingRequest)(nil), "mwitkow.testproto.PingRequest")
  56. proto.RegisterType((*PingResponse)(nil), "mwitkow.testproto.PingResponse")
  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.SupportPackageIsVersion3
  64. // Client API for TestService service
  65. type TestServiceClient interface {
  66. PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error)
  67. Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
  68. PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error)
  69. PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error)
  70. }
  71. type testServiceClient struct {
  72. cc *grpc.ClientConn
  73. }
  74. func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient {
  75. return &testServiceClient{cc}
  76. }
  77. func (c *testServiceClient) PingEmpty(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PingResponse, error) {
  78. out := new(PingResponse)
  79. err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingEmpty", in, out, c.cc, opts...)
  80. if err != nil {
  81. return nil, err
  82. }
  83. return out, nil
  84. }
  85. func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
  86. out := new(PingResponse)
  87. err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/Ping", in, out, c.cc, opts...)
  88. if err != nil {
  89. return nil, err
  90. }
  91. return out, nil
  92. }
  93. func (c *testServiceClient) PingError(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*Empty, error) {
  94. out := new(Empty)
  95. err := grpc.Invoke(ctx, "/mwitkow.testproto.TestService/PingError", in, out, c.cc, opts...)
  96. if err != nil {
  97. return nil, err
  98. }
  99. return out, nil
  100. }
  101. func (c *testServiceClient) PingList(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (TestService_PingListClient, error) {
  102. stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/mwitkow.testproto.TestService/PingList", opts...)
  103. if err != nil {
  104. return nil, err
  105. }
  106. x := &testServicePingListClient{stream}
  107. if err := x.ClientStream.SendMsg(in); err != nil {
  108. return nil, err
  109. }
  110. if err := x.ClientStream.CloseSend(); err != nil {
  111. return nil, err
  112. }
  113. return x, nil
  114. }
  115. type TestService_PingListClient interface {
  116. Recv() (*PingResponse, error)
  117. grpc.ClientStream
  118. }
  119. type testServicePingListClient struct {
  120. grpc.ClientStream
  121. }
  122. func (x *testServicePingListClient) Recv() (*PingResponse, error) {
  123. m := new(PingResponse)
  124. if err := x.ClientStream.RecvMsg(m); err != nil {
  125. return nil, err
  126. }
  127. return m, nil
  128. }
  129. // Server API for TestService service
  130. type TestServiceServer interface {
  131. PingEmpty(context.Context, *Empty) (*PingResponse, error)
  132. Ping(context.Context, *PingRequest) (*PingResponse, error)
  133. PingError(context.Context, *PingRequest) (*Empty, error)
  134. PingList(*PingRequest, TestService_PingListServer) error
  135. }
  136. func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) {
  137. s.RegisterService(&_TestService_serviceDesc, srv)
  138. }
  139. func _TestService_PingEmpty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  140. in := new(Empty)
  141. if err := dec(in); err != nil {
  142. return nil, err
  143. }
  144. if interceptor == nil {
  145. return srv.(TestServiceServer).PingEmpty(ctx, in)
  146. }
  147. info := &grpc.UnaryServerInfo{
  148. Server: srv,
  149. FullMethod: "/mwitkow.testproto.TestService/PingEmpty",
  150. }
  151. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  152. return srv.(TestServiceServer).PingEmpty(ctx, req.(*Empty))
  153. }
  154. return interceptor(ctx, in, info, handler)
  155. }
  156. func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  157. in := new(PingRequest)
  158. if err := dec(in); err != nil {
  159. return nil, err
  160. }
  161. if interceptor == nil {
  162. return srv.(TestServiceServer).Ping(ctx, in)
  163. }
  164. info := &grpc.UnaryServerInfo{
  165. Server: srv,
  166. FullMethod: "/mwitkow.testproto.TestService/Ping",
  167. }
  168. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  169. return srv.(TestServiceServer).Ping(ctx, req.(*PingRequest))
  170. }
  171. return interceptor(ctx, in, info, handler)
  172. }
  173. func _TestService_PingError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  174. in := new(PingRequest)
  175. if err := dec(in); err != nil {
  176. return nil, err
  177. }
  178. if interceptor == nil {
  179. return srv.(TestServiceServer).PingError(ctx, in)
  180. }
  181. info := &grpc.UnaryServerInfo{
  182. Server: srv,
  183. FullMethod: "/mwitkow.testproto.TestService/PingError",
  184. }
  185. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  186. return srv.(TestServiceServer).PingError(ctx, req.(*PingRequest))
  187. }
  188. return interceptor(ctx, in, info, handler)
  189. }
  190. func _TestService_PingList_Handler(srv interface{}, stream grpc.ServerStream) error {
  191. m := new(PingRequest)
  192. if err := stream.RecvMsg(m); err != nil {
  193. return err
  194. }
  195. return srv.(TestServiceServer).PingList(m, &testServicePingListServer{stream})
  196. }
  197. type TestService_PingListServer interface {
  198. Send(*PingResponse) error
  199. grpc.ServerStream
  200. }
  201. type testServicePingListServer struct {
  202. grpc.ServerStream
  203. }
  204. func (x *testServicePingListServer) Send(m *PingResponse) error {
  205. return x.ServerStream.SendMsg(m)
  206. }
  207. var _TestService_serviceDesc = grpc.ServiceDesc{
  208. ServiceName: "mwitkow.testproto.TestService",
  209. HandlerType: (*TestServiceServer)(nil),
  210. Methods: []grpc.MethodDesc{
  211. {
  212. MethodName: "PingEmpty",
  213. Handler: _TestService_PingEmpty_Handler,
  214. },
  215. {
  216. MethodName: "Ping",
  217. Handler: _TestService_Ping_Handler,
  218. },
  219. {
  220. MethodName: "PingError",
  221. Handler: _TestService_PingError_Handler,
  222. },
  223. },
  224. Streams: []grpc.StreamDesc{
  225. {
  226. StreamName: "PingList",
  227. Handler: _TestService_PingList_Handler,
  228. ServerStreams: true,
  229. },
  230. },
  231. Metadata: fileDescriptor0,
  232. }
  233. func init() { proto.RegisterFile("test.proto", fileDescriptor0) }
  234. var fileDescriptor0 = []byte{
  235. // 273 bytes of a gzipped FileDescriptorProto
  236. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x90, 0xcf, 0x4b, 0xc3, 0x30,
  237. 0x14, 0xc7, 0xd7, 0x69, 0x9d, 0x7b, 0x75, 0x87, 0x45, 0x0f, 0xc5, 0x83, 0x96, 0x9c, 0x7a, 0x0a,
  238. 0xa2, 0x77, 0x2f, 0x22, 0x2a, 0x28, 0x4a, 0x1c, 0x5e, 0x8b, 0xb6, 0x0f, 0x09, 0x2e, 0x4d, 0x4d,
  239. 0x5e, 0x57, 0xfc, 0xdf, 0xfc, 0xe3, 0x24, 0x59, 0x05, 0x61, 0x0e, 0x3d, 0xec, 0x98, 0xcf, 0xf7,
  240. 0xf1, 0xfd, 0x11, 0x00, 0x42, 0x47, 0xa2, 0xb1, 0x86, 0x0c, 0x9b, 0xea, 0x4e, 0xd1, 0x9b, 0xe9,
  241. 0x84, 0x67, 0x01, 0xf1, 0x11, 0xc4, 0x97, 0xba, 0xa1, 0x0f, 0xde, 0x41, 0xf2, 0xa0, 0xea, 0x57,
  242. 0x89, 0xef, 0x2d, 0x3a, 0x62, 0x07, 0x10, 0x2f, 0x9e, 0xe7, 0x2d, 0xa6, 0x51, 0x16, 0xe5, 0x63,
  243. 0xb9, 0x7c, 0x30, 0x0e, 0x13, 0x37, 0x47, 0x6c, 0x0a, 0x52, 0x1a, 0x0b, 0xed, 0xd2, 0x61, 0x16,
  244. 0xe5, 0xb1, 0x4c, 0x02, 0x9c, 0x29, 0x8d, 0x77, 0x8e, 0x09, 0xd8, 0x47, 0x6b, 0x8d, 0x2d, 0x4a,
  245. 0x53, 0x61, 0x61, 0x91, 0x5a, 0x5b, 0x63, 0x95, 0x6e, 0x65, 0x51, 0x3e, 0x91, 0xd3, 0x20, 0x5d,
  246. 0x98, 0x0a, 0x65, 0x2f, 0xf0, 0x73, 0xd8, 0x5b, 0x06, 0xbb, 0xc6, 0xd4, 0x0e, 0x7d, 0xf2, 0xd3,
  247. 0x6a, 0x72, 0x0a, 0xa3, 0xd2, 0xb4, 0x35, 0xa1, 0xed, 0x33, 0xbf, 0x9f, 0xa7, 0x9f, 0x43, 0x48,
  248. 0x66, 0xe8, 0xe8, 0x11, 0xed, 0x42, 0x95, 0xc8, 0xae, 0x61, 0xec, 0xfd, 0xc2, 0x2a, 0x96, 0x8a,
  249. 0x95, 0xc9, 0x22, 0x28, 0x87, 0xc7, 0xbf, 0x28, 0x3f, 0x7b, 0xf0, 0x01, 0xbb, 0x81, 0x6d, 0x4f,
  250. 0xd8, 0xd1, 0xda, 0xd3, 0xf0, 0x57, 0xff, 0xb1, 0xba, 0xea, 0x4b, 0xf9, 0xf5, 0x7f, 0xfa, 0xad,
  251. 0x2d, 0xcd, 0x07, 0xec, 0x1e, 0x76, 0xfd, 0xe9, 0xad, 0x72, 0xb4, 0x81, 0x5e, 0x27, 0xd1, 0xcb,
  252. 0x4e, 0xe0, 0x67, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x38, 0x3e, 0x02, 0xe9, 0x28, 0x02, 0x00,
  253. 0x00,
  254. }