test.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.25.0-devel
  4. // protoc v3.13.0
  5. // source: test.proto
  6. package linux
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  13. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  14. reflect "reflect"
  15. sync "sync"
  16. )
  17. const (
  18. // Verify that this generated code is sufficiently up-to-date.
  19. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  20. // Verify that runtime/protoimpl is sufficiently up-to-date.
  21. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  22. )
  23. type HelloReply struct {
  24. state protoimpl.MessageState
  25. sizeCache protoimpl.SizeCache
  26. unknownFields protoimpl.UnknownFields
  27. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
  28. }
  29. func (x *HelloReply) Reset() {
  30. *x = HelloReply{}
  31. if protoimpl.UnsafeEnabled {
  32. mi := &file_test_proto_msgTypes[0]
  33. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  34. ms.StoreMessageInfo(mi)
  35. }
  36. }
  37. func (x *HelloReply) String() string {
  38. return protoimpl.X.MessageStringOf(x)
  39. }
  40. func (*HelloReply) ProtoMessage() {}
  41. func (x *HelloReply) ProtoReflect() protoreflect.Message {
  42. mi := &file_test_proto_msgTypes[0]
  43. if protoimpl.UnsafeEnabled && x != nil {
  44. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  45. if ms.LoadMessageInfo() == nil {
  46. ms.StoreMessageInfo(mi)
  47. }
  48. return ms
  49. }
  50. return mi.MessageOf(x)
  51. }
  52. // Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
  53. func (*HelloReply) Descriptor() ([]byte, []int) {
  54. return file_test_proto_rawDescGZIP(), []int{0}
  55. }
  56. func (x *HelloReply) GetMessage() string {
  57. if x != nil {
  58. return x.Message
  59. }
  60. return ""
  61. }
  62. type HelloRequest struct {
  63. state protoimpl.MessageState
  64. sizeCache protoimpl.SizeCache
  65. unknownFields protoimpl.UnknownFields
  66. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  67. }
  68. func (x *HelloRequest) Reset() {
  69. *x = HelloRequest{}
  70. if protoimpl.UnsafeEnabled {
  71. mi := &file_test_proto_msgTypes[1]
  72. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  73. ms.StoreMessageInfo(mi)
  74. }
  75. }
  76. func (x *HelloRequest) String() string {
  77. return protoimpl.X.MessageStringOf(x)
  78. }
  79. func (*HelloRequest) ProtoMessage() {}
  80. func (x *HelloRequest) ProtoReflect() protoreflect.Message {
  81. mi := &file_test_proto_msgTypes[1]
  82. if protoimpl.UnsafeEnabled && x != nil {
  83. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  84. if ms.LoadMessageInfo() == nil {
  85. ms.StoreMessageInfo(mi)
  86. }
  87. return ms
  88. }
  89. return mi.MessageOf(x)
  90. }
  91. // Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
  92. func (*HelloRequest) Descriptor() ([]byte, []int) {
  93. return file_test_proto_rawDescGZIP(), []int{1}
  94. }
  95. func (x *HelloRequest) GetName() string {
  96. if x != nil {
  97. return x.Name
  98. }
  99. return ""
  100. }
  101. var File_test_proto protoreflect.FileDescriptor
  102. var file_test_proto_rawDesc = []byte{
  103. 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x6c, 0x69,
  104. 0x6e, 0x75, 0x78, 0x22, 0x26, 0x0a, 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c,
  105. 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01,
  106. 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x22, 0x0a, 0x0c, 0x48,
  107. 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
  108. 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32,
  109. 0x75, 0x0a, 0x07, 0x47, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x08, 0x53, 0x61,
  110. 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x13, 0x2e, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x2e, 0x48,
  111. 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x69,
  112. 0x6e, 0x75, 0x78, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00,
  113. 0x12, 0x34, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x11, 0x2e, 0x6c,
  114. 0x69, 0x6e, 0x75, 0x78, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x1a,
  115. 0x13, 0x2e, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71,
  116. 0x75, 0x65, 0x73, 0x74, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x6c, 0x69, 0x6e, 0x75,
  117. 0x78, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  118. }
  119. var (
  120. file_test_proto_rawDescOnce sync.Once
  121. file_test_proto_rawDescData = file_test_proto_rawDesc
  122. )
  123. func file_test_proto_rawDescGZIP() []byte {
  124. file_test_proto_rawDescOnce.Do(func() {
  125. file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)
  126. })
  127. return file_test_proto_rawDescData
  128. }
  129. var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  130. var file_test_proto_goTypes = []interface{}{
  131. (*HelloReply)(nil), // 0: linux.HelloReply
  132. (*HelloRequest)(nil), // 1: linux.HelloRequest
  133. }
  134. var file_test_proto_depIdxs = []int32{
  135. 1, // 0: linux.Greeter.SayHello:input_type -> linux.HelloRequest
  136. 0, // 1: linux.Greeter.SayReply:input_type -> linux.HelloReply
  137. 0, // 2: linux.Greeter.SayHello:output_type -> linux.HelloReply
  138. 1, // 3: linux.Greeter.SayReply:output_type -> linux.HelloRequest
  139. 2, // [2:4] is the sub-list for method output_type
  140. 0, // [0:2] is the sub-list for method input_type
  141. 0, // [0:0] is the sub-list for extension type_name
  142. 0, // [0:0] is the sub-list for extension extendee
  143. 0, // [0:0] is the sub-list for field type_name
  144. }
  145. func init() { file_test_proto_init() }
  146. func file_test_proto_init() {
  147. if File_test_proto != nil {
  148. return
  149. }
  150. if !protoimpl.UnsafeEnabled {
  151. file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  152. switch v := v.(*HelloReply); i {
  153. case 0:
  154. return &v.state
  155. case 1:
  156. return &v.sizeCache
  157. case 2:
  158. return &v.unknownFields
  159. default:
  160. return nil
  161. }
  162. }
  163. file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  164. switch v := v.(*HelloRequest); i {
  165. case 0:
  166. return &v.state
  167. case 1:
  168. return &v.sizeCache
  169. case 2:
  170. return &v.unknownFields
  171. default:
  172. return nil
  173. }
  174. }
  175. }
  176. type x struct{}
  177. out := protoimpl.TypeBuilder{
  178. File: protoimpl.DescBuilder{
  179. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  180. RawDescriptor: file_test_proto_rawDesc,
  181. NumEnums: 0,
  182. NumMessages: 2,
  183. NumExtensions: 0,
  184. NumServices: 1,
  185. },
  186. GoTypes: file_test_proto_goTypes,
  187. DependencyIndexes: file_test_proto_depIdxs,
  188. MessageInfos: file_test_proto_msgTypes,
  189. }.Build()
  190. File_test_proto = out.File
  191. file_test_proto_rawDesc = nil
  192. file_test_proto_goTypes = nil
  193. file_test_proto_depIdxs = nil
  194. }
  195. // Reference imports to suppress errors if they are not otherwise used.
  196. var _ context.Context
  197. var _ grpc.ClientConnInterface
  198. // This is a compile-time assertion to ensure that this generated file
  199. // is compatible with the grpc package it is being compiled against.
  200. const _ = grpc.SupportPackageIsVersion6
  201. // GreeterClient is the client API for Greeter service.
  202. //
  203. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  204. type GreeterClient interface {
  205. SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
  206. SayReply(ctx context.Context, in *HelloReply, opts ...grpc.CallOption) (*HelloRequest, error)
  207. }
  208. type greeterClient struct {
  209. cc grpc.ClientConnInterface
  210. }
  211. func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
  212. return &greeterClient{cc}
  213. }
  214. func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
  215. out := new(HelloReply)
  216. err := c.cc.Invoke(ctx, "/linux.Greeter/SayHello", in, out, opts...)
  217. if err != nil {
  218. return nil, err
  219. }
  220. return out, nil
  221. }
  222. func (c *greeterClient) SayReply(ctx context.Context, in *HelloReply, opts ...grpc.CallOption) (*HelloRequest, error) {
  223. out := new(HelloRequest)
  224. err := c.cc.Invoke(ctx, "/linux.Greeter/SayReply", in, out, opts...)
  225. if err != nil {
  226. return nil, err
  227. }
  228. return out, nil
  229. }
  230. // GreeterServer is the server API for Greeter service.
  231. type GreeterServer interface {
  232. SayHello(context.Context, *HelloRequest) (*HelloReply, error)
  233. SayReply(context.Context, *HelloReply) (*HelloRequest, error)
  234. }
  235. // UnimplementedGreeterServer can be embedded to have forward compatible implementations.
  236. type UnimplementedGreeterServer struct {
  237. }
  238. func (*UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error) {
  239. return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
  240. }
  241. func (*UnimplementedGreeterServer) SayReply(context.Context, *HelloReply) (*HelloRequest, error) {
  242. return nil, status.Errorf(codes.Unimplemented, "method SayReply not implemented")
  243. }
  244. func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
  245. s.RegisterService(&_Greeter_serviceDesc, srv)
  246. }
  247. func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  248. in := new(HelloRequest)
  249. if err := dec(in); err != nil {
  250. return nil, err
  251. }
  252. if interceptor == nil {
  253. return srv.(GreeterServer).SayHello(ctx, in)
  254. }
  255. info := &grpc.UnaryServerInfo{
  256. Server: srv,
  257. FullMethod: "/linux.Greeter/SayHello",
  258. }
  259. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  260. return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest))
  261. }
  262. return interceptor(ctx, in, info, handler)
  263. }
  264. func _Greeter_SayReply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  265. in := new(HelloReply)
  266. if err := dec(in); err != nil {
  267. return nil, err
  268. }
  269. if interceptor == nil {
  270. return srv.(GreeterServer).SayReply(ctx, in)
  271. }
  272. info := &grpc.UnaryServerInfo{
  273. Server: srv,
  274. FullMethod: "/linux.Greeter/SayReply",
  275. }
  276. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  277. return srv.(GreeterServer).SayReply(ctx, req.(*HelloReply))
  278. }
  279. return interceptor(ctx, in, info, handler)
  280. }
  281. var _Greeter_serviceDesc = grpc.ServiceDesc{
  282. ServiceName: "linux.Greeter",
  283. HandlerType: (*GreeterServer)(nil),
  284. Methods: []grpc.MethodDesc{
  285. {
  286. MethodName: "SayHello",
  287. Handler: _Greeter_SayHello_Handler,
  288. },
  289. {
  290. MethodName: "SayReply",
  291. Handler: _Greeter_SayReply_Handler,
  292. },
  293. },
  294. Streams: []grpc.StreamDesc{},
  295. Metadata: "test.proto",
  296. }