ocr.pb.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: ocr.proto
  3. //OCR图像转文字服务
  4. package proto
  5. import (
  6. context "context"
  7. fmt "fmt"
  8. proto "github.com/golang/protobuf/proto"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. math "math"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = fmt.Errorf
  17. var _ = math.Inf
  18. // This is a compile-time assertion to ensure that this generated file
  19. // is compatible with the proto package it is being compiled against.
  20. // A compilation error at this line likely means your copy of the
  21. // proto package needs to be updated.
  22. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  23. type OcrRequest struct {
  24. Image []byte `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
  25. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  26. XXX_unrecognized []byte `json:"-"`
  27. XXX_sizecache int32 `json:"-"`
  28. }
  29. func (m *OcrRequest) Reset() { *m = OcrRequest{} }
  30. func (m *OcrRequest) String() string { return proto.CompactTextString(m) }
  31. func (*OcrRequest) ProtoMessage() {}
  32. func (*OcrRequest) Descriptor() ([]byte, []int) {
  33. return fileDescriptor_52282bc2e1d222c6, []int{0}
  34. }
  35. func (m *OcrRequest) XXX_Unmarshal(b []byte) error {
  36. return xxx_messageInfo_OcrRequest.Unmarshal(m, b)
  37. }
  38. func (m *OcrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  39. return xxx_messageInfo_OcrRequest.Marshal(b, m, deterministic)
  40. }
  41. func (m *OcrRequest) XXX_Merge(src proto.Message) {
  42. xxx_messageInfo_OcrRequest.Merge(m, src)
  43. }
  44. func (m *OcrRequest) XXX_Size() int {
  45. return xxx_messageInfo_OcrRequest.Size(m)
  46. }
  47. func (m *OcrRequest) XXX_DiscardUnknown() {
  48. xxx_messageInfo_OcrRequest.DiscardUnknown(m)
  49. }
  50. var xxx_messageInfo_OcrRequest proto.InternalMessageInfo
  51. func (m *OcrRequest) GetImage() []byte {
  52. if m != nil {
  53. return m.Image
  54. }
  55. return nil
  56. }
  57. type OcrResponse struct {
  58. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
  59. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  60. XXX_unrecognized []byte `json:"-"`
  61. XXX_sizecache int32 `json:"-"`
  62. }
  63. func (m *OcrResponse) Reset() { *m = OcrResponse{} }
  64. func (m *OcrResponse) String() string { return proto.CompactTextString(m) }
  65. func (*OcrResponse) ProtoMessage() {}
  66. func (*OcrResponse) Descriptor() ([]byte, []int) {
  67. return fileDescriptor_52282bc2e1d222c6, []int{1}
  68. }
  69. func (m *OcrResponse) XXX_Unmarshal(b []byte) error {
  70. return xxx_messageInfo_OcrResponse.Unmarshal(m, b)
  71. }
  72. func (m *OcrResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  73. return xxx_messageInfo_OcrResponse.Marshal(b, m, deterministic)
  74. }
  75. func (m *OcrResponse) XXX_Merge(src proto.Message) {
  76. xxx_messageInfo_OcrResponse.Merge(m, src)
  77. }
  78. func (m *OcrResponse) XXX_Size() int {
  79. return xxx_messageInfo_OcrResponse.Size(m)
  80. }
  81. func (m *OcrResponse) XXX_DiscardUnknown() {
  82. xxx_messageInfo_OcrResponse.DiscardUnknown(m)
  83. }
  84. var xxx_messageInfo_OcrResponse proto.InternalMessageInfo
  85. func (m *OcrResponse) GetMessage() string {
  86. if m != nil {
  87. return m.Message
  88. }
  89. return ""
  90. }
  91. func init() {
  92. proto.RegisterType((*OcrRequest)(nil), "proto.OcrRequest")
  93. proto.RegisterType((*OcrResponse)(nil), "proto.OcrResponse")
  94. }
  95. func init() {
  96. proto.RegisterFile("ocr.proto", fileDescriptor_52282bc2e1d222c6)
  97. }
  98. var fileDescriptor_52282bc2e1d222c6 = []byte{
  99. // 124 bytes of a gzipped FileDescriptorProto
  100. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcc, 0x4f, 0x2e, 0xd2,
  101. 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x4a, 0x5c, 0x5c, 0xfe, 0xc9, 0x45,
  102. 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x22, 0x5c, 0xac, 0x99, 0xb9, 0x89, 0xe9, 0xa9,
  103. 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x10, 0x8e, 0x92, 0x3a, 0x17, 0x37, 0x58, 0x4d, 0x71,
  104. 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x71, 0x31, 0x4c, 0x19, 0x67,
  105. 0x10, 0x8c, 0x6b, 0x64, 0xcc, 0xc5, 0xec, 0x9f, 0x5c, 0x24, 0xa4, 0x03, 0xa1, 0x04, 0x21, 0x36,
  106. 0xe9, 0x21, 0xcc, 0x97, 0x12, 0x42, 0x16, 0x82, 0x18, 0x97, 0xc4, 0x06, 0x16, 0x32, 0x06, 0x04,
  107. 0x00, 0x00, 0xff, 0xff, 0xd9, 0x2d, 0xf8, 0xb2, 0x9c, 0x00, 0x00, 0x00,
  108. }
  109. // Reference imports to suppress errors if they are not otherwise used.
  110. var _ context.Context
  111. var _ grpc.ClientConnInterface
  112. // This is a compile-time assertion to ensure that this generated file
  113. // is compatible with the grpc package it is being compiled against.
  114. const _ = grpc.SupportPackageIsVersion6
  115. // OcrClient is the client API for Ocr service.
  116. //
  117. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  118. type OcrClient interface {
  119. Ocr(ctx context.Context, in *OcrRequest, opts ...grpc.CallOption) (*OcrResponse, error)
  120. }
  121. type ocrClient struct {
  122. cc grpc.ClientConnInterface
  123. }
  124. func NewOcrClient(cc grpc.ClientConnInterface) OcrClient {
  125. return &ocrClient{cc}
  126. }
  127. func (c *ocrClient) Ocr(ctx context.Context, in *OcrRequest, opts ...grpc.CallOption) (*OcrResponse, error) {
  128. out := new(OcrResponse)
  129. err := c.cc.Invoke(ctx, "/proto.Ocr/Ocr", in, out, opts...)
  130. if err != nil {
  131. return nil, err
  132. }
  133. return out, nil
  134. }
  135. // OcrServer is the server API for Ocr service.
  136. type OcrServer interface {
  137. Ocr(context.Context, *OcrRequest) (*OcrResponse, error)
  138. }
  139. // UnimplementedOcrServer can be embedded to have forward compatible implementations.
  140. type UnimplementedOcrServer struct {
  141. }
  142. func (*UnimplementedOcrServer) Ocr(ctx context.Context, req *OcrRequest) (*OcrResponse, error) {
  143. return nil, status.Errorf(codes.Unimplemented, "method Ocr not implemented")
  144. }
  145. func RegisterOcrServer(s *grpc.Server, srv OcrServer) {
  146. s.RegisterService(&_Ocr_serviceDesc, srv)
  147. }
  148. func _Ocr_Ocr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  149. in := new(OcrRequest)
  150. if err := dec(in); err != nil {
  151. return nil, err
  152. }
  153. if interceptor == nil {
  154. return srv.(OcrServer).Ocr(ctx, in)
  155. }
  156. info := &grpc.UnaryServerInfo{
  157. Server: srv,
  158. FullMethod: "/proto.Ocr/Ocr",
  159. }
  160. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  161. return srv.(OcrServer).Ocr(ctx, req.(*OcrRequest))
  162. }
  163. return interceptor(ctx, in, info, handler)
  164. }
  165. var _Ocr_serviceDesc = grpc.ServiceDesc{
  166. ServiceName: "proto.Ocr",
  167. HandlerType: (*OcrServer)(nil),
  168. Methods: []grpc.MethodDesc{
  169. {
  170. MethodName: "Ocr",
  171. Handler: _Ocr_Ocr_Handler,
  172. },
  173. },
  174. Streams: []grpc.StreamDesc{},
  175. Metadata: "ocr.proto",
  176. }