ocrv1

package
v1.16.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package ocrv1 is a generated GoMock package.

Index

Constants

View Source
const (
	OCRService_Recognize_FullMethodName = "/ocr.v1.OCRService/Recognize"
	OCRService_Status_FullMethodName    = "/ocr.v1.OCRService/Status"
)

Variables

View Source
var File_ocr_v1_ocr_proto protoreflect.FileDescriptor
View Source
var OCRService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ocr.v1.OCRService",
	HandlerType: (*OCRServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Recognize",
			Handler:    _OCRService_Recognize_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _OCRService_Status_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ocr/v1/ocr.proto",
}

OCRService_ServiceDesc is the grpc.ServiceDesc for OCRService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOCRServiceServer

func RegisterOCRServiceServer(s grpc.ServiceRegistrar, srv OCRServiceServer)

func ToContext

func ToContext(ctx context.Context, ocrClient *OCRClient) context.Context

Types

type MockOCRServiceClient

type MockOCRServiceClient struct {
	// contains filtered or unexported fields
}

MockOCRServiceClient is a mock of OCRServiceClient interface.

func NewMockOCRServiceClient

func NewMockOCRServiceClient(ctrl *gomock.Controller) *MockOCRServiceClient

NewMockOCRServiceClient creates a new mock instance.

func (*MockOCRServiceClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockOCRServiceClient) Recognize

Recognize mocks base method.

func (*MockOCRServiceClient) Status

Status mocks base method.

type MockOCRServiceClientMockRecorder

type MockOCRServiceClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockOCRServiceClientMockRecorder is the mock recorder for MockOCRServiceClient.

func (*MockOCRServiceClientMockRecorder) Recognize

func (mr *MockOCRServiceClientMockRecorder) Recognize(ctx, in any, opts ...any) *gomock.Call

Recognize indicates an expected call of Recognize.

func (*MockOCRServiceClientMockRecorder) Status

func (mr *MockOCRServiceClientMockRecorder) Status(ctx, in any, opts ...any) *gomock.Call

Status indicates an expected call of Status.

type MockOCRServiceServer

type MockOCRServiceServer struct {
	// contains filtered or unexported fields
}

MockOCRServiceServer is a mock of OCRServiceServer interface.

func NewMockOCRServiceServer

func NewMockOCRServiceServer(ctrl *gomock.Controller) *MockOCRServiceServer

NewMockOCRServiceServer creates a new mock instance.

func (*MockOCRServiceServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockOCRServiceServer) Recognize

Recognize mocks base method.

func (*MockOCRServiceServer) Status

Status mocks base method.

type MockOCRServiceServerMockRecorder

type MockOCRServiceServerMockRecorder struct {
	// contains filtered or unexported fields
}

MockOCRServiceServerMockRecorder is the mock recorder for MockOCRServiceServer.

func (*MockOCRServiceServerMockRecorder) Recognize

func (mr *MockOCRServiceServerMockRecorder) Recognize(arg0, arg1 any) *gomock.Call

Recognize indicates an expected call of Recognize.

func (*MockOCRServiceServerMockRecorder) Status

func (mr *MockOCRServiceServerMockRecorder) Status(arg0, arg1 any) *gomock.Call

Status indicates an expected call of Status.

type MockUnsafeOCRServiceServer

type MockUnsafeOCRServiceServer struct {
	// contains filtered or unexported fields
}

MockUnsafeOCRServiceServer is a mock of UnsafeOCRServiceServer interface.

func NewMockUnsafeOCRServiceServer

func NewMockUnsafeOCRServiceServer(ctrl *gomock.Controller) *MockUnsafeOCRServiceServer

NewMockUnsafeOCRServiceServer creates a new mock instance.

func (*MockUnsafeOCRServiceServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockUnsafeOCRServiceServerMockRecorder

type MockUnsafeOCRServiceServerMockRecorder struct {
	// contains filtered or unexported fields
}

MockUnsafeOCRServiceServerMockRecorder is the mock recorder for MockUnsafeOCRServiceServer.

type OCRClient

type OCRClient struct {
	*common.GrpcClientBase

	// The gRPC API Client.
	Client OCRServiceClient
}

OCRClient is a Client for interacting with the profile service API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func FromContext

func FromContext(ctx context.Context) *OCRClient

func Init added in v1.9.1

func Init(cBase *common.GrpcClientBase, service OCRServiceClient) *OCRClient

func NewOCRClient

func NewOCRClient(ctx context.Context, opts ...common.ClientOption) (*OCRClient, error)

NewOCRClient creates a new ocr Client. The service that an application uses to perform ocr requests

func (*OCRClient) Recognize

func (pc *OCRClient) Recognize(ctx context.Context, id string, language string, properties map[string]string, fileId ...string) (*RecognizeResponse, error)

func (*OCRClient) StatusCheck

func (pc *OCRClient) StatusCheck(ctx context.Context, id string) (*StatusResponse, error)

type OCRFile

type OCRFile struct {
	FileId     string            `protobuf:"bytes,1,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	Language   string            `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"`
	Status     v1.STATUS         `protobuf:"varint,3,opt,name=status,proto3,enum=common.v1.STATUS" json:"status,omitempty"`
	Text       string            `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
	Properties map[string]string `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*OCRFile) Descriptor deprecated

func (*OCRFile) Descriptor() ([]byte, []int)

Deprecated: Use OCRFile.ProtoReflect.Descriptor instead.

func (*OCRFile) GetFileId

func (x *OCRFile) GetFileId() string

func (*OCRFile) GetLanguage

func (x *OCRFile) GetLanguage() string

func (*OCRFile) GetProperties

func (x *OCRFile) GetProperties() map[string]string

func (*OCRFile) GetStatus

func (x *OCRFile) GetStatus() v1.STATUS

func (*OCRFile) GetText

func (x *OCRFile) GetText() string

func (*OCRFile) ProtoMessage

func (*OCRFile) ProtoMessage()

func (*OCRFile) ProtoReflect

func (x *OCRFile) ProtoReflect() protoreflect.Message

func (*OCRFile) Reset

func (x *OCRFile) Reset()

func (*OCRFile) String

func (x *OCRFile) String() string

type OCRServiceClient

type OCRServiceClient interface {
	// Perform a new ocr process request
	Recognize(ctx context.Context, in *RecognizeRequest, opts ...grpc.CallOption) (*RecognizeResponse, error)
	// Check the status of request if queued
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
}

OCRServiceClient is the client API for OCRService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewOCRServiceClient

func NewOCRServiceClient(cc grpc.ClientConnInterface) OCRServiceClient

type OCRServiceServer

type OCRServiceServer interface {
	// Perform a new ocr process request
	Recognize(context.Context, *RecognizeRequest) (*RecognizeResponse, error)
	// Check the status of request if queued
	Status(context.Context, *StatusRequest) (*StatusResponse, error)
	// contains filtered or unexported methods
}

OCRServiceServer is the server API for OCRService service. All implementations must embed UnimplementedOCRServiceServer for forward compatibility

type RecognizeRequest

type RecognizeRequest struct {
	ReferenceId string            `protobuf:"bytes,1,opt,name=reference_id,json=referenceId,proto3" json:"reference_id,omitempty"`
	LanguageId  string            `protobuf:"bytes,2,opt,name=language_id,json=languageId,proto3" json:"language_id,omitempty"`
	Properties  map[string]string `` /* 161-byte string literal not displayed */
	Async       bool              `protobuf:"varint,4,opt,name=async,proto3" json:"async,omitempty"`
	FileId      []string          `protobuf:"bytes,5,rep,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	// contains filtered or unexported fields
}

Request to determine text found in a file

func (*RecognizeRequest) Descriptor deprecated

func (*RecognizeRequest) Descriptor() ([]byte, []int)

Deprecated: Use RecognizeRequest.ProtoReflect.Descriptor instead.

func (*RecognizeRequest) GetAsync

func (x *RecognizeRequest) GetAsync() bool

func (*RecognizeRequest) GetFileId

func (x *RecognizeRequest) GetFileId() []string

func (*RecognizeRequest) GetLanguageId

func (x *RecognizeRequest) GetLanguageId() string

func (*RecognizeRequest) GetProperties

func (x *RecognizeRequest) GetProperties() map[string]string

func (*RecognizeRequest) GetReferenceId

func (x *RecognizeRequest) GetReferenceId() string

func (*RecognizeRequest) ProtoMessage

func (*RecognizeRequest) ProtoMessage()

func (*RecognizeRequest) ProtoReflect

func (x *RecognizeRequest) ProtoReflect() protoreflect.Message

func (*RecognizeRequest) Reset

func (x *RecognizeRequest) Reset()

func (*RecognizeRequest) String

func (x *RecognizeRequest) String() string

type RecognizeResponse

type RecognizeResponse struct {
	ReferenceId string     `protobuf:"bytes,1,opt,name=reference_id,json=referenceId,proto3" json:"reference_id,omitempty"`
	Result      []*OCRFile `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*RecognizeResponse) Descriptor deprecated

func (*RecognizeResponse) Descriptor() ([]byte, []int)

Deprecated: Use RecognizeResponse.ProtoReflect.Descriptor instead.

func (*RecognizeResponse) GetReferenceId

func (x *RecognizeResponse) GetReferenceId() string

func (*RecognizeResponse) GetResult

func (x *RecognizeResponse) GetResult() []*OCRFile

func (*RecognizeResponse) ProtoMessage

func (*RecognizeResponse) ProtoMessage()

func (*RecognizeResponse) ProtoReflect

func (x *RecognizeResponse) ProtoReflect() protoreflect.Message

func (*RecognizeResponse) Reset

func (x *RecognizeResponse) Reset()

func (*RecognizeResponse) String

func (x *RecognizeResponse) String() string

type StatusRequest

type StatusRequest struct {
	Id     string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Extras map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*StatusRequest) Descriptor deprecated

func (*StatusRequest) Descriptor() ([]byte, []int)

Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.

func (*StatusRequest) GetExtras

func (x *StatusRequest) GetExtras() map[string]string

func (*StatusRequest) GetId

func (x *StatusRequest) GetId() string

func (*StatusRequest) ProtoMessage

func (*StatusRequest) ProtoMessage()

func (*StatusRequest) ProtoReflect

func (x *StatusRequest) ProtoReflect() protoreflect.Message

func (*StatusRequest) Reset

func (x *StatusRequest) Reset()

func (*StatusRequest) String

func (x *StatusRequest) String() string

type StatusResponse

type StatusResponse struct {
	Data *RecognizeResponse `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusResponse) Descriptor deprecated

func (*StatusResponse) Descriptor() ([]byte, []int)

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetData

func (x *StatusResponse) GetData() *RecognizeResponse

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

func (x *StatusResponse) ProtoReflect() protoreflect.Message

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

type UnimplementedOCRServiceServer

type UnimplementedOCRServiceServer struct {
}

UnimplementedOCRServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedOCRServiceServer) Recognize

func (UnimplementedOCRServiceServer) Status

type UnsafeOCRServiceServer

type UnsafeOCRServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeOCRServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OCRServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL