book.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.26.0
  4. // protoc v3.20.0
  5. // source: book.proto
  6. package pb
  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 Request struct {
  24. state protoimpl.MessageState
  25. sizeCache protoimpl.SizeCache
  26. unknownFields protoimpl.UnknownFields
  27. Par string `protobuf:"bytes,1,opt,name=par,proto3" json:"par,omitempty"`
  28. }
  29. func (x *Request) Reset() {
  30. *x = Request{}
  31. if protoimpl.UnsafeEnabled {
  32. mi := &file_book_proto_msgTypes[0]
  33. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  34. ms.StoreMessageInfo(mi)
  35. }
  36. }
  37. func (x *Request) String() string {
  38. return protoimpl.X.MessageStringOf(x)
  39. }
  40. func (*Request) ProtoMessage() {}
  41. func (x *Request) ProtoReflect() protoreflect.Message {
  42. mi := &file_book_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 Request.ProtoReflect.Descriptor instead.
  53. func (*Request) Descriptor() ([]byte, []int) {
  54. return file_book_proto_rawDescGZIP(), []int{0}
  55. }
  56. func (x *Request) GetPar() string {
  57. if x != nil {
  58. return x.Par
  59. }
  60. return ""
  61. }
  62. type BookInfo struct {
  63. state protoimpl.MessageState
  64. sizeCache protoimpl.SizeCache
  65. unknownFields protoimpl.UnknownFields
  66. Book *Book `protobuf:"bytes,1,opt,name=book,proto3" json:"book,omitempty"`
  67. }
  68. func (x *BookInfo) Reset() {
  69. *x = BookInfo{}
  70. if protoimpl.UnsafeEnabled {
  71. mi := &file_book_proto_msgTypes[1]
  72. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  73. ms.StoreMessageInfo(mi)
  74. }
  75. }
  76. func (x *BookInfo) String() string {
  77. return protoimpl.X.MessageStringOf(x)
  78. }
  79. func (*BookInfo) ProtoMessage() {}
  80. func (x *BookInfo) ProtoReflect() protoreflect.Message {
  81. mi := &file_book_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 BookInfo.ProtoReflect.Descriptor instead.
  92. func (*BookInfo) Descriptor() ([]byte, []int) {
  93. return file_book_proto_rawDescGZIP(), []int{1}
  94. }
  95. func (x *BookInfo) GetBook() *Book {
  96. if x != nil {
  97. return x.Book
  98. }
  99. return nil
  100. }
  101. type Book struct {
  102. state protoimpl.MessageState
  103. sizeCache protoimpl.SizeCache
  104. unknownFields protoimpl.UnknownFields
  105. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  106. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
  107. }
  108. func (x *Book) Reset() {
  109. *x = Book{}
  110. if protoimpl.UnsafeEnabled {
  111. mi := &file_book_proto_msgTypes[2]
  112. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  113. ms.StoreMessageInfo(mi)
  114. }
  115. }
  116. func (x *Book) String() string {
  117. return protoimpl.X.MessageStringOf(x)
  118. }
  119. func (*Book) ProtoMessage() {}
  120. func (x *Book) ProtoReflect() protoreflect.Message {
  121. mi := &file_book_proto_msgTypes[2]
  122. if protoimpl.UnsafeEnabled && x != nil {
  123. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  124. if ms.LoadMessageInfo() == nil {
  125. ms.StoreMessageInfo(mi)
  126. }
  127. return ms
  128. }
  129. return mi.MessageOf(x)
  130. }
  131. // Deprecated: Use Book.ProtoReflect.Descriptor instead.
  132. func (*Book) Descriptor() ([]byte, []int) {
  133. return file_book_proto_rawDescGZIP(), []int{2}
  134. }
  135. func (x *Book) GetId() string {
  136. if x != nil {
  137. return x.Id
  138. }
  139. return ""
  140. }
  141. func (x *Book) GetName() string {
  142. if x != nil {
  143. return x.Name
  144. }
  145. return ""
  146. }
  147. type BookList struct {
  148. state protoimpl.MessageState
  149. sizeCache protoimpl.SizeCache
  150. unknownFields protoimpl.UnknownFields
  151. Books []*Book `protobuf:"bytes,1,rep,name=books,proto3" json:"books,omitempty"`
  152. }
  153. func (x *BookList) Reset() {
  154. *x = BookList{}
  155. if protoimpl.UnsafeEnabled {
  156. mi := &file_book_proto_msgTypes[3]
  157. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  158. ms.StoreMessageInfo(mi)
  159. }
  160. }
  161. func (x *BookList) String() string {
  162. return protoimpl.X.MessageStringOf(x)
  163. }
  164. func (*BookList) ProtoMessage() {}
  165. func (x *BookList) ProtoReflect() protoreflect.Message {
  166. mi := &file_book_proto_msgTypes[3]
  167. if protoimpl.UnsafeEnabled && x != nil {
  168. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  169. if ms.LoadMessageInfo() == nil {
  170. ms.StoreMessageInfo(mi)
  171. }
  172. return ms
  173. }
  174. return mi.MessageOf(x)
  175. }
  176. // Deprecated: Use BookList.ProtoReflect.Descriptor instead.
  177. func (*BookList) Descriptor() ([]byte, []int) {
  178. return file_book_proto_rawDescGZIP(), []int{3}
  179. }
  180. func (x *BookList) GetBooks() []*Book {
  181. if x != nil {
  182. return x.Books
  183. }
  184. return nil
  185. }
  186. var File_book_proto protoreflect.FileDescriptor
  187. var file_book_proto_rawDesc = []byte{
  188. 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
  189. 0x22, 0x1b, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70,
  190. 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x61, 0x72, 0x22, 0x28, 0x0a,
  191. 0x08, 0x42, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x04, 0x62, 0x6f, 0x6f,
  192. 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f,
  193. 0x6b, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x2a, 0x0a, 0x04, 0x42, 0x6f, 0x6f, 0x6b, 0x12,
  194. 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
  195. 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
  196. 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x08, 0x42, 0x6f, 0x6f, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12,
  197. 0x1e, 0x0a, 0x05, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08,
  198. 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x05, 0x62, 0x6f, 0x6f, 0x6b, 0x73, 0x32,
  199. 0x5c, 0x0a, 0x0a, 0x42, 0x6f, 0x6f, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x24, 0x0a,
  200. 0x0b, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x70,
  201. 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x42,
  202. 0x6f, 0x6f, 0x6b, 0x12, 0x28, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x4c, 0x69,
  203. 0x73, 0x74, 0x12, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
  204. 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x04, 0x5a,
  205. 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  206. }
  207. var (
  208. file_book_proto_rawDescOnce sync.Once
  209. file_book_proto_rawDescData = file_book_proto_rawDesc
  210. )
  211. func file_book_proto_rawDescGZIP() []byte {
  212. file_book_proto_rawDescOnce.Do(func() {
  213. file_book_proto_rawDescData = protoimpl.X.CompressGZIP(file_book_proto_rawDescData)
  214. })
  215. return file_book_proto_rawDescData
  216. }
  217. var file_book_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
  218. var file_book_proto_goTypes = []interface{}{
  219. (*Request)(nil), // 0: pb.Request
  220. (*BookInfo)(nil), // 1: pb.BookInfo
  221. (*Book)(nil), // 2: pb.Book
  222. (*BookList)(nil), // 3: pb.BookList
  223. }
  224. var file_book_proto_depIdxs = []int32{
  225. 2, // 0: pb.BookInfo.book:type_name -> pb.Book
  226. 2, // 1: pb.BookList.books:type_name -> pb.Book
  227. 0, // 2: pb.BookServer.GetBookInfo:input_type -> pb.Request
  228. 0, // 3: pb.BookServer.GetBookList:input_type -> pb.Request
  229. 2, // 4: pb.BookServer.GetBookInfo:output_type -> pb.Book
  230. 3, // 5: pb.BookServer.GetBookList:output_type -> pb.BookList
  231. 4, // [4:6] is the sub-list for method output_type
  232. 2, // [2:4] is the sub-list for method input_type
  233. 2, // [2:2] is the sub-list for extension type_name
  234. 2, // [2:2] is the sub-list for extension extendee
  235. 0, // [0:2] is the sub-list for field type_name
  236. }
  237. func init() { file_book_proto_init() }
  238. func file_book_proto_init() {
  239. if File_book_proto != nil {
  240. return
  241. }
  242. if !protoimpl.UnsafeEnabled {
  243. file_book_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  244. switch v := v.(*Request); i {
  245. case 0:
  246. return &v.state
  247. case 1:
  248. return &v.sizeCache
  249. case 2:
  250. return &v.unknownFields
  251. default:
  252. return nil
  253. }
  254. }
  255. file_book_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  256. switch v := v.(*BookInfo); i {
  257. case 0:
  258. return &v.state
  259. case 1:
  260. return &v.sizeCache
  261. case 2:
  262. return &v.unknownFields
  263. default:
  264. return nil
  265. }
  266. }
  267. file_book_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
  268. switch v := v.(*Book); i {
  269. case 0:
  270. return &v.state
  271. case 1:
  272. return &v.sizeCache
  273. case 2:
  274. return &v.unknownFields
  275. default:
  276. return nil
  277. }
  278. }
  279. file_book_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
  280. switch v := v.(*BookList); i {
  281. case 0:
  282. return &v.state
  283. case 1:
  284. return &v.sizeCache
  285. case 2:
  286. return &v.unknownFields
  287. default:
  288. return nil
  289. }
  290. }
  291. }
  292. type x struct{}
  293. out := protoimpl.TypeBuilder{
  294. File: protoimpl.DescBuilder{
  295. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  296. RawDescriptor: file_book_proto_rawDesc,
  297. NumEnums: 0,
  298. NumMessages: 4,
  299. NumExtensions: 0,
  300. NumServices: 1,
  301. },
  302. GoTypes: file_book_proto_goTypes,
  303. DependencyIndexes: file_book_proto_depIdxs,
  304. MessageInfos: file_book_proto_msgTypes,
  305. }.Build()
  306. File_book_proto = out.File
  307. file_book_proto_rawDesc = nil
  308. file_book_proto_goTypes = nil
  309. file_book_proto_depIdxs = nil
  310. }
  311. // Reference imports to suppress errors if they are not otherwise used.
  312. var _ context.Context
  313. var _ grpc.ClientConnInterface
  314. // This is a compile-time assertion to ensure that this generated file
  315. // is compatible with the grpc package it is being compiled against.
  316. const _ = grpc.SupportPackageIsVersion6
  317. // BookServerClient is the client API for BookServer service.
  318. //
  319. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  320. type BookServerClient interface {
  321. GetBookInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Book, error)
  322. GetBookList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*BookList, error)
  323. }
  324. type bookServerClient struct {
  325. cc grpc.ClientConnInterface
  326. }
  327. func NewBookServerClient(cc grpc.ClientConnInterface) BookServerClient {
  328. return &bookServerClient{cc}
  329. }
  330. func (c *bookServerClient) GetBookInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Book, error) {
  331. out := new(Book)
  332. err := c.cc.Invoke(ctx, "/pb.BookServer/GetBookInfo", in, out, opts...)
  333. if err != nil {
  334. return nil, err
  335. }
  336. return out, nil
  337. }
  338. func (c *bookServerClient) GetBookList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*BookList, error) {
  339. out := new(BookList)
  340. err := c.cc.Invoke(ctx, "/pb.BookServer/GetBookList", in, out, opts...)
  341. if err != nil {
  342. return nil, err
  343. }
  344. return out, nil
  345. }
  346. // BookServerServer is the server API for BookServer service.
  347. type BookServerServer interface {
  348. GetBookInfo(context.Context, *Request) (*Book, error)
  349. GetBookList(context.Context, *Request) (*BookList, error)
  350. }
  351. // UnimplementedBookServerServer can be embedded to have forward compatible implementations.
  352. type UnimplementedBookServerServer struct {
  353. }
  354. func (*UnimplementedBookServerServer) GetBookInfo(context.Context, *Request) (*Book, error) {
  355. return nil, status.Errorf(codes.Unimplemented, "method GetBookInfo not implemented")
  356. }
  357. func (*UnimplementedBookServerServer) GetBookList(context.Context, *Request) (*BookList, error) {
  358. return nil, status.Errorf(codes.Unimplemented, "method GetBookList not implemented")
  359. }
  360. func RegisterBookServerServer(s *grpc.Server, srv BookServerServer) {
  361. s.RegisterService(&_BookServer_serviceDesc, srv)
  362. }
  363. func _BookServer_GetBookInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  364. in := new(Request)
  365. if err := dec(in); err != nil {
  366. return nil, err
  367. }
  368. if interceptor == nil {
  369. return srv.(BookServerServer).GetBookInfo(ctx, in)
  370. }
  371. info := &grpc.UnaryServerInfo{
  372. Server: srv,
  373. FullMethod: "/pb.BookServer/GetBookInfo",
  374. }
  375. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  376. return srv.(BookServerServer).GetBookInfo(ctx, req.(*Request))
  377. }
  378. return interceptor(ctx, in, info, handler)
  379. }
  380. func _BookServer_GetBookList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  381. in := new(Request)
  382. if err := dec(in); err != nil {
  383. return nil, err
  384. }
  385. if interceptor == nil {
  386. return srv.(BookServerServer).GetBookList(ctx, in)
  387. }
  388. info := &grpc.UnaryServerInfo{
  389. Server: srv,
  390. FullMethod: "/pb.BookServer/GetBookList",
  391. }
  392. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  393. return srv.(BookServerServer).GetBookList(ctx, req.(*Request))
  394. }
  395. return interceptor(ctx, in, info, handler)
  396. }
  397. var _BookServer_serviceDesc = grpc.ServiceDesc{
  398. ServiceName: "pb.BookServer",
  399. HandlerType: (*BookServerServer)(nil),
  400. Methods: []grpc.MethodDesc{
  401. {
  402. MethodName: "GetBookInfo",
  403. Handler: _BookServer_GetBookInfo_Handler,
  404. },
  405. {
  406. MethodName: "GetBookList",
  407. Handler: _BookServer_GetBookList_Handler,
  408. },
  409. },
  410. Streams: []grpc.StreamDesc{},
  411. Metadata: "book.proto",
  412. }