check.pb.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // Code generated by protoc-gen-go.
  2. // source: check.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package check is a generated protocol buffer package.
  6. It is generated from these files:
  7. check.proto
  8. It has these top-level messages:
  9. CheckReq
  10. CheckResp
  11. */
  12. package check
  13. import proto "github.com/golang/protobuf/proto"
  14. import fmt "fmt"
  15. import math "math"
  16. import (
  17. context "golang.org/x/net/context"
  18. grpc "google.golang.org/grpc"
  19. )
  20. // Reference imports to suppress errors if they are not otherwise used.
  21. var _ = proto.Marshal
  22. var _ = fmt.Errorf
  23. var _ = math.Inf
  24. // This is a compile-time assertion to ensure that this generated file
  25. // is compatible with the proto package it is being compiled against.
  26. // A compilation error at this line likely means your copy of the
  27. // proto package needs to be updated.
  28. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  29. type CheckReq struct {
  30. Book string `protobuf:"bytes,1,opt,name=book" json:"book,omitempty"`
  31. }
  32. func (m *CheckReq) Reset() { *m = CheckReq{} }
  33. func (m *CheckReq) String() string { return proto.CompactTextString(m) }
  34. func (*CheckReq) ProtoMessage() {}
  35. func (*CheckReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  36. func (m *CheckReq) GetBook() string {
  37. if m != nil {
  38. return m.Book
  39. }
  40. return ""
  41. }
  42. type CheckResp struct {
  43. Found bool `protobuf:"varint,1,opt,name=found" json:"found,omitempty"`
  44. Price int64 `protobuf:"varint,2,opt,name=price" json:"price,omitempty"`
  45. }
  46. func (m *CheckResp) Reset() { *m = CheckResp{} }
  47. func (m *CheckResp) String() string { return proto.CompactTextString(m) }
  48. func (*CheckResp) ProtoMessage() {}
  49. func (*CheckResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  50. func (m *CheckResp) GetFound() bool {
  51. if m != nil {
  52. return m.Found
  53. }
  54. return false
  55. }
  56. func (m *CheckResp) GetPrice() int64 {
  57. if m != nil {
  58. return m.Price
  59. }
  60. return 0
  61. }
  62. func init() {
  63. proto.RegisterType((*CheckReq)(nil), "check.checkReq")
  64. proto.RegisterType((*CheckResp)(nil), "check.checkResp")
  65. }
  66. // Reference imports to suppress errors if they are not otherwise used.
  67. var _ context.Context
  68. var _ grpc.ClientConn
  69. // This is a compile-time assertion to ensure that this generated file
  70. // is compatible with the grpc package it is being compiled against.
  71. const _ = grpc.SupportPackageIsVersion4
  72. // Client API for Checker service
  73. type CheckerClient interface {
  74. Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error)
  75. }
  76. type checkerClient struct {
  77. cc *grpc.ClientConn
  78. }
  79. func NewCheckerClient(cc *grpc.ClientConn) CheckerClient {
  80. return &checkerClient{cc}
  81. }
  82. func (c *checkerClient) Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error) {
  83. out := new(CheckResp)
  84. err := grpc.Invoke(ctx, "/check.checker/check", in, out, c.cc, opts...)
  85. if err != nil {
  86. return nil, err
  87. }
  88. return out, nil
  89. }
  90. // Server API for Checker service
  91. type CheckerServer interface {
  92. Check(context.Context, *CheckReq) (*CheckResp, error)
  93. }
  94. func RegisterCheckerServer(s *grpc.Server, srv CheckerServer) {
  95. s.RegisterService(&_Checker_serviceDesc, srv)
  96. }
  97. func _Checker_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  98. in := new(CheckReq)
  99. if err := dec(in); err != nil {
  100. return nil, err
  101. }
  102. if interceptor == nil {
  103. return srv.(CheckerServer).Check(ctx, in)
  104. }
  105. info := &grpc.UnaryServerInfo{
  106. Server: srv,
  107. FullMethod: "/check.checker/Check",
  108. }
  109. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  110. return srv.(CheckerServer).Check(ctx, req.(*CheckReq))
  111. }
  112. return interceptor(ctx, in, info, handler)
  113. }
  114. var _Checker_serviceDesc = grpc.ServiceDesc{
  115. ServiceName: "check.checker",
  116. HandlerType: (*CheckerServer)(nil),
  117. Methods: []grpc.MethodDesc{
  118. {
  119. MethodName: "check",
  120. Handler: _Checker_Check_Handler,
  121. },
  122. },
  123. Streams: []grpc.StreamDesc{},
  124. Metadata: "check.proto",
  125. }
  126. func init() { proto.RegisterFile("check.proto", fileDescriptor0) }
  127. var fileDescriptor0 = []byte{
  128. // 136 bytes of a gzipped FileDescriptorProto
  129. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0xce, 0x48, 0x4d,
  130. 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x73, 0x94, 0xe4, 0xb8, 0x38, 0xc0,
  131. 0x8c, 0xa0, 0xd4, 0x42, 0x21, 0x21, 0x2e, 0x96, 0xa4, 0xfc, 0xfc, 0x6c, 0x09, 0x46, 0x05, 0x46,
  132. 0x0d, 0xce, 0x20, 0x30, 0x5b, 0xc9, 0x9c, 0x8b, 0x13, 0x2a, 0x5f, 0x5c, 0x20, 0x24, 0xc2, 0xc5,
  133. 0x9a, 0x96, 0x5f, 0x9a, 0x97, 0x02, 0x56, 0xc1, 0x11, 0x04, 0xe1, 0x80, 0x44, 0x0b, 0x8a, 0x32,
  134. 0x93, 0x53, 0x25, 0x98, 0x14, 0x18, 0x35, 0x98, 0x83, 0x20, 0x1c, 0x23, 0x53, 0x2e, 0x76, 0xb0,
  135. 0xc6, 0xd4, 0x22, 0x21, 0x2d, 0x2e, 0x88, 0x65, 0x42, 0xfc, 0x7a, 0x10, 0x17, 0xc0, 0x6c, 0x94,
  136. 0x12, 0x40, 0x15, 0x28, 0x2e, 0x48, 0x62, 0x03, 0xbb, 0xce, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff,
  137. 0x6e, 0x6f, 0xa7, 0x1d, 0xac, 0x00, 0x00, 0x00,
  138. }