123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- // Code generated by protoc-gen-go. DO NOT EDIT.
- // source: ocr.proto
- //OCR图像转文字服务
- package proto
- import (
- context "context"
- fmt "fmt"
- proto "github.com/golang/protobuf/proto"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- math "math"
- )
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the proto package it is being compiled against.
- // A compilation error at this line likely means your copy of the
- // proto package needs to be updated.
- const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
- type OcrRequest struct {
- Image []byte `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *OcrRequest) Reset() { *m = OcrRequest{} }
- func (m *OcrRequest) String() string { return proto.CompactTextString(m) }
- func (*OcrRequest) ProtoMessage() {}
- func (*OcrRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_52282bc2e1d222c6, []int{0}
- }
- func (m *OcrRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OcrRequest.Unmarshal(m, b)
- }
- func (m *OcrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OcrRequest.Marshal(b, m, deterministic)
- }
- func (m *OcrRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OcrRequest.Merge(m, src)
- }
- func (m *OcrRequest) XXX_Size() int {
- return xxx_messageInfo_OcrRequest.Size(m)
- }
- func (m *OcrRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_OcrRequest.DiscardUnknown(m)
- }
- var xxx_messageInfo_OcrRequest proto.InternalMessageInfo
- func (m *OcrRequest) GetImage() []byte {
- if m != nil {
- return m.Image
- }
- return nil
- }
- type OcrResponse struct {
- Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *OcrResponse) Reset() { *m = OcrResponse{} }
- func (m *OcrResponse) String() string { return proto.CompactTextString(m) }
- func (*OcrResponse) ProtoMessage() {}
- func (*OcrResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_52282bc2e1d222c6, []int{1}
- }
- func (m *OcrResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_OcrResponse.Unmarshal(m, b)
- }
- func (m *OcrResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_OcrResponse.Marshal(b, m, deterministic)
- }
- func (m *OcrResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_OcrResponse.Merge(m, src)
- }
- func (m *OcrResponse) XXX_Size() int {
- return xxx_messageInfo_OcrResponse.Size(m)
- }
- func (m *OcrResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_OcrResponse.DiscardUnknown(m)
- }
- var xxx_messageInfo_OcrResponse proto.InternalMessageInfo
- func (m *OcrResponse) GetMessage() string {
- if m != nil {
- return m.Message
- }
- return ""
- }
- func init() {
- proto.RegisterType((*OcrRequest)(nil), "proto.OcrRequest")
- proto.RegisterType((*OcrResponse)(nil), "proto.OcrResponse")
- }
- func init() {
- proto.RegisterFile("ocr.proto", fileDescriptor_52282bc2e1d222c6)
- }
- var fileDescriptor_52282bc2e1d222c6 = []byte{
- // 124 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcc, 0x4f, 0x2e, 0xd2,
- 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x4a, 0x5c, 0x5c, 0xfe, 0xc9, 0x45,
- 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x22, 0x5c, 0xac, 0x99, 0xb9, 0x89, 0xe9, 0xa9,
- 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x10, 0x8e, 0x92, 0x3a, 0x17, 0x37, 0x58, 0x4d, 0x71,
- 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x71, 0x31, 0x4c, 0x19, 0x67,
- 0x10, 0x8c, 0x6b, 0x64, 0xcc, 0xc5, 0xec, 0x9f, 0x5c, 0x24, 0xa4, 0x03, 0xa1, 0x04, 0x21, 0x36,
- 0xe9, 0x21, 0xcc, 0x97, 0x12, 0x42, 0x16, 0x82, 0x18, 0x97, 0xc4, 0x06, 0x16, 0x32, 0x06, 0x04,
- 0x00, 0x00, 0xff, 0xff, 0xd9, 0x2d, 0xf8, 0xb2, 0x9c, 0x00, 0x00, 0x00,
- }
- // Reference imports to suppress errors if they are not otherwise used.
- var _ context.Context
- var _ grpc.ClientConnInterface
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the grpc package it is being compiled against.
- const _ = grpc.SupportPackageIsVersion6
- // OcrClient is the client API for Ocr service.
- //
- // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
- type OcrClient interface {
- Ocr(ctx context.Context, in *OcrRequest, opts ...grpc.CallOption) (*OcrResponse, error)
- }
- type ocrClient struct {
- cc grpc.ClientConnInterface
- }
- func NewOcrClient(cc grpc.ClientConnInterface) OcrClient {
- return &ocrClient{cc}
- }
- func (c *ocrClient) Ocr(ctx context.Context, in *OcrRequest, opts ...grpc.CallOption) (*OcrResponse, error) {
- out := new(OcrResponse)
- err := c.cc.Invoke(ctx, "/proto.Ocr/Ocr", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- // OcrServer is the server API for Ocr service.
- type OcrServer interface {
- Ocr(context.Context, *OcrRequest) (*OcrResponse, error)
- }
- // UnimplementedOcrServer can be embedded to have forward compatible implementations.
- type UnimplementedOcrServer struct {
- }
- func (*UnimplementedOcrServer) Ocr(ctx context.Context, req *OcrRequest) (*OcrResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Ocr not implemented")
- }
- func RegisterOcrServer(s *grpc.Server, srv OcrServer) {
- s.RegisterService(&_Ocr_serviceDesc, srv)
- }
- func _Ocr_Ocr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(OcrRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(OcrServer).Ocr(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/proto.Ocr/Ocr",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(OcrServer).Ocr(ctx, req.(*OcrRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- var _Ocr_serviceDesc = grpc.ServiceDesc{
- ServiceName: "proto.Ocr",
- HandlerType: (*OcrServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Ocr",
- Handler: _Ocr_Ocr_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "ocr.proto",
- }
|