check.pb.go 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.25.0
  4. // protoc v3.14.0
  5. // source: check.proto
  6. package check
  7. import (
  8. context "context"
  9. proto "github.com/golang/protobuf/proto"
  10. grpc "google.golang.org/grpc"
  11. codes "google.golang.org/grpc/codes"
  12. status "google.golang.org/grpc/status"
  13. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  14. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  15. reflect "reflect"
  16. sync "sync"
  17. )
  18. const (
  19. // Verify that this generated code is sufficiently up-to-date.
  20. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  21. // Verify that runtime/protoimpl is sufficiently up-to-date.
  22. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  23. )
  24. // This is a compile-time assertion that a sufficiently up-to-date version
  25. // of the legacy proto package is being used.
  26. const _ = proto.ProtoPackageIsVersion4
  27. type CheckReq struct {
  28. state protoimpl.MessageState
  29. sizeCache protoimpl.SizeCache
  30. unknownFields protoimpl.UnknownFields
  31. Book string `protobuf:"bytes,1,opt,name=book,proto3" json:"book,omitempty"`
  32. }
  33. func (x *CheckReq) Reset() {
  34. *x = CheckReq{}
  35. if protoimpl.UnsafeEnabled {
  36. mi := &file_check_proto_msgTypes[0]
  37. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  38. ms.StoreMessageInfo(mi)
  39. }
  40. }
  41. func (x *CheckReq) String() string {
  42. return protoimpl.X.MessageStringOf(x)
  43. }
  44. func (*CheckReq) ProtoMessage() {}
  45. func (x *CheckReq) ProtoReflect() protoreflect.Message {
  46. mi := &file_check_proto_msgTypes[0]
  47. if protoimpl.UnsafeEnabled && x != nil {
  48. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  49. if ms.LoadMessageInfo() == nil {
  50. ms.StoreMessageInfo(mi)
  51. }
  52. return ms
  53. }
  54. return mi.MessageOf(x)
  55. }
  56. // Deprecated: Use CheckReq.ProtoReflect.Descriptor instead.
  57. func (*CheckReq) Descriptor() ([]byte, []int) {
  58. return file_check_proto_rawDescGZIP(), []int{0}
  59. }
  60. func (x *CheckReq) GetBook() string {
  61. if x != nil {
  62. return x.Book
  63. }
  64. return ""
  65. }
  66. type CheckResp struct {
  67. state protoimpl.MessageState
  68. sizeCache protoimpl.SizeCache
  69. unknownFields protoimpl.UnknownFields
  70. Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"`
  71. Price int64 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"`
  72. }
  73. func (x *CheckResp) Reset() {
  74. *x = CheckResp{}
  75. if protoimpl.UnsafeEnabled {
  76. mi := &file_check_proto_msgTypes[1]
  77. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  78. ms.StoreMessageInfo(mi)
  79. }
  80. }
  81. func (x *CheckResp) String() string {
  82. return protoimpl.X.MessageStringOf(x)
  83. }
  84. func (*CheckResp) ProtoMessage() {}
  85. func (x *CheckResp) ProtoReflect() protoreflect.Message {
  86. mi := &file_check_proto_msgTypes[1]
  87. if protoimpl.UnsafeEnabled && x != nil {
  88. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  89. if ms.LoadMessageInfo() == nil {
  90. ms.StoreMessageInfo(mi)
  91. }
  92. return ms
  93. }
  94. return mi.MessageOf(x)
  95. }
  96. // Deprecated: Use CheckResp.ProtoReflect.Descriptor instead.
  97. func (*CheckResp) Descriptor() ([]byte, []int) {
  98. return file_check_proto_rawDescGZIP(), []int{1}
  99. }
  100. func (x *CheckResp) GetFound() bool {
  101. if x != nil {
  102. return x.Found
  103. }
  104. return false
  105. }
  106. func (x *CheckResp) GetPrice() int64 {
  107. if x != nil {
  108. return x.Price
  109. }
  110. return 0
  111. }
  112. var File_check_proto protoreflect.FileDescriptor
  113. var file_check_proto_rawDesc = []byte{
  114. 0x0a, 0x0b, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x63,
  115. 0x68, 0x65, 0x63, 0x6b, 0x22, 0x1e, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71,
  116. 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
  117. 0x62, 0x6f, 0x6f, 0x6b, 0x22, 0x37, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73,
  118. 0x70, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
  119. 0x52, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65,
  120. 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x32, 0x35, 0x0a,
  121. 0x07, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x05, 0x63, 0x68, 0x65, 0x63,
  122. 0x6b, 0x12, 0x0f, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52,
  123. 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b,
  124. 0x52, 0x65, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  125. }
  126. var (
  127. file_check_proto_rawDescOnce sync.Once
  128. file_check_proto_rawDescData = file_check_proto_rawDesc
  129. )
  130. func file_check_proto_rawDescGZIP() []byte {
  131. file_check_proto_rawDescOnce.Do(func() {
  132. file_check_proto_rawDescData = protoimpl.X.CompressGZIP(file_check_proto_rawDescData)
  133. })
  134. return file_check_proto_rawDescData
  135. }
  136. var file_check_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  137. var file_check_proto_goTypes = []interface{}{
  138. (*CheckReq)(nil), // 0: check.checkReq
  139. (*CheckResp)(nil), // 1: check.checkResp
  140. }
  141. var file_check_proto_depIdxs = []int32{
  142. 0, // 0: check.checker.check:input_type -> check.checkReq
  143. 1, // 1: check.checker.check:output_type -> check.checkResp
  144. 1, // [1:2] is the sub-list for method output_type
  145. 0, // [0:1] is the sub-list for method input_type
  146. 0, // [0:0] is the sub-list for extension type_name
  147. 0, // [0:0] is the sub-list for extension extendee
  148. 0, // [0:0] is the sub-list for field type_name
  149. }
  150. func init() { file_check_proto_init() }
  151. func file_check_proto_init() {
  152. if File_check_proto != nil {
  153. return
  154. }
  155. if !protoimpl.UnsafeEnabled {
  156. file_check_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  157. switch v := v.(*CheckReq); i {
  158. case 0:
  159. return &v.state
  160. case 1:
  161. return &v.sizeCache
  162. case 2:
  163. return &v.unknownFields
  164. default:
  165. return nil
  166. }
  167. }
  168. file_check_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  169. switch v := v.(*CheckResp); i {
  170. case 0:
  171. return &v.state
  172. case 1:
  173. return &v.sizeCache
  174. case 2:
  175. return &v.unknownFields
  176. default:
  177. return nil
  178. }
  179. }
  180. }
  181. type x struct{}
  182. out := protoimpl.TypeBuilder{
  183. File: protoimpl.DescBuilder{
  184. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  185. RawDescriptor: file_check_proto_rawDesc,
  186. NumEnums: 0,
  187. NumMessages: 2,
  188. NumExtensions: 0,
  189. NumServices: 1,
  190. },
  191. GoTypes: file_check_proto_goTypes,
  192. DependencyIndexes: file_check_proto_depIdxs,
  193. MessageInfos: file_check_proto_msgTypes,
  194. }.Build()
  195. File_check_proto = out.File
  196. file_check_proto_rawDesc = nil
  197. file_check_proto_goTypes = nil
  198. file_check_proto_depIdxs = nil
  199. }
  200. // Reference imports to suppress errors if they are not otherwise used.
  201. var _ context.Context
  202. var _ grpc.ClientConnInterface
  203. // This is a compile-time assertion to ensure that this generated file
  204. // is compatible with the grpc package it is being compiled against.
  205. const _ = grpc.SupportPackageIsVersion6
  206. // CheckerClient is the client API for Checker service.
  207. //
  208. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  209. type CheckerClient interface {
  210. Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error)
  211. }
  212. type checkerClient struct {
  213. cc grpc.ClientConnInterface
  214. }
  215. func NewCheckerClient(cc grpc.ClientConnInterface) CheckerClient {
  216. return &checkerClient{cc}
  217. }
  218. func (c *checkerClient) Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error) {
  219. out := new(CheckResp)
  220. err := c.cc.Invoke(ctx, "/check.checker/check", in, out, opts...)
  221. if err != nil {
  222. return nil, err
  223. }
  224. return out, nil
  225. }
  226. // CheckerServer is the server API for Checker service.
  227. type CheckerServer interface {
  228. Check(context.Context, *CheckReq) (*CheckResp, error)
  229. }
  230. // UnimplementedCheckerServer can be embedded to have forward compatible implementations.
  231. type UnimplementedCheckerServer struct {
  232. }
  233. func (*UnimplementedCheckerServer) Check(context.Context, *CheckReq) (*CheckResp, error) {
  234. return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
  235. }
  236. func RegisterCheckerServer(s *grpc.Server, srv CheckerServer) {
  237. s.RegisterService(&_Checker_serviceDesc, srv)
  238. }
  239. func _Checker_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  240. in := new(CheckReq)
  241. if err := dec(in); err != nil {
  242. return nil, err
  243. }
  244. if interceptor == nil {
  245. return srv.(CheckerServer).Check(ctx, in)
  246. }
  247. info := &grpc.UnaryServerInfo{
  248. Server: srv,
  249. FullMethod: "/check.checker/Check",
  250. }
  251. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  252. return srv.(CheckerServer).Check(ctx, req.(*CheckReq))
  253. }
  254. return interceptor(ctx, in, info, handler)
  255. }
  256. var _Checker_serviceDesc = grpc.ServiceDesc{
  257. ServiceName: "check.checker",
  258. HandlerType: (*CheckerServer)(nil),
  259. Methods: []grpc.MethodDesc{
  260. {
  261. MethodName: "check",
  262. Handler: _Checker_Check_Handler,
  263. },
  264. },
  265. Streams: []grpc.StreamDesc{},
  266. Metadata: "check.proto",
  267. }