add.pb.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // Code generated by protoc-gen-go.
  2. // source: add.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package add is a generated protocol buffer package.
  6. It is generated from these files:
  7. add.proto
  8. It has these top-level messages:
  9. AddReq
  10. AddResp
  11. */
  12. package add
  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 AddReq struct {
  30. Book string `protobuf:"bytes,1,opt,name=book" json:"book,omitempty"`
  31. Price int64 `protobuf:"varint,2,opt,name=price" json:"price,omitempty"`
  32. }
  33. func (m *AddReq) Reset() { *m = AddReq{} }
  34. func (m *AddReq) String() string { return proto.CompactTextString(m) }
  35. func (*AddReq) ProtoMessage() {}
  36. func (*AddReq) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  37. func (m *AddReq) GetBook() string {
  38. if m != nil {
  39. return m.Book
  40. }
  41. return ""
  42. }
  43. func (m *AddReq) GetPrice() int64 {
  44. if m != nil {
  45. return m.Price
  46. }
  47. return 0
  48. }
  49. type AddResp struct {
  50. Ok bool `protobuf:"varint,1,opt,name=ok" json:"ok,omitempty"`
  51. }
  52. func (m *AddResp) Reset() { *m = AddResp{} }
  53. func (m *AddResp) String() string { return proto.CompactTextString(m) }
  54. func (*AddResp) ProtoMessage() {}
  55. func (*AddResp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  56. func (m *AddResp) GetOk() bool {
  57. if m != nil {
  58. return m.Ok
  59. }
  60. return false
  61. }
  62. func init() {
  63. proto.RegisterType((*AddReq)(nil), "add.addReq")
  64. proto.RegisterType((*AddResp)(nil), "add.addResp")
  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 Adder service
  73. type AdderClient interface {
  74. Add(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
  75. }
  76. type adderClient struct {
  77. cc *grpc.ClientConn
  78. }
  79. func NewAdderClient(cc *grpc.ClientConn) AdderClient {
  80. return &adderClient{cc}
  81. }
  82. func (c *adderClient) Add(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
  83. out := new(AddResp)
  84. err := grpc.Invoke(ctx, "/add.adder/add", in, out, c.cc, opts...)
  85. if err != nil {
  86. return nil, err
  87. }
  88. return out, nil
  89. }
  90. // Server API for Adder service
  91. type AdderServer interface {
  92. Add(context.Context, *AddReq) (*AddResp, error)
  93. }
  94. func RegisterAdderServer(s *grpc.Server, srv AdderServer) {
  95. s.RegisterService(&_Adder_serviceDesc, srv)
  96. }
  97. func _Adder_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  98. in := new(AddReq)
  99. if err := dec(in); err != nil {
  100. return nil, err
  101. }
  102. if interceptor == nil {
  103. return srv.(AdderServer).Add(ctx, in)
  104. }
  105. info := &grpc.UnaryServerInfo{
  106. Server: srv,
  107. FullMethod: "/add.adder/Add",
  108. }
  109. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  110. return srv.(AdderServer).Add(ctx, req.(*AddReq))
  111. }
  112. return interceptor(ctx, in, info, handler)
  113. }
  114. var _Adder_serviceDesc = grpc.ServiceDesc{
  115. ServiceName: "add.adder",
  116. HandlerType: (*AdderServer)(nil),
  117. Methods: []grpc.MethodDesc{
  118. {
  119. MethodName: "add",
  120. Handler: _Adder_Add_Handler,
  121. },
  122. },
  123. Streams: []grpc.StreamDesc{},
  124. Metadata: "add.proto",
  125. }
  126. func init() { proto.RegisterFile("add.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, 0x4c, 0x4c, 0x49, 0xd1,
  130. 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x4c, 0x49, 0x51, 0x32, 0xe2, 0x62, 0x4b, 0x4c,
  131. 0x49, 0x09, 0x4a, 0x2d, 0x14, 0x12, 0xe2, 0x62, 0x49, 0xca, 0xcf, 0xcf, 0x96, 0x60, 0x54, 0x60,
  132. 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x44, 0xb8, 0x58, 0x0b, 0x8a, 0x32, 0x93, 0x53, 0x25, 0x98,
  133. 0x14, 0x18, 0x35, 0x98, 0x83, 0x20, 0x1c, 0x25, 0x49, 0x2e, 0x76, 0xb0, 0x9e, 0xe2, 0x02, 0x21,
  134. 0x3e, 0x2e, 0x26, 0xa8, 0x16, 0x8e, 0x20, 0xa6, 0xfc, 0x6c, 0x23, 0x4d, 0x2e, 0xd6, 0xc4, 0x94,
  135. 0x94, 0xd4, 0x22, 0x21, 0x05, 0x2e, 0x90, 0xf1, 0x42, 0xdc, 0x7a, 0x20, 0xfb, 0x20, 0x36, 0x48,
  136. 0xf1, 0x20, 0x38, 0xc5, 0x05, 0x49, 0x6c, 0x60, 0x57, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
  137. 0xe2, 0x6d, 0xb5, 0x91, 0x92, 0x00, 0x00, 0x00,
  138. }