ocrv1

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

README

service-ocr-api

A repository for the ocr service api being developed for ant investors to push images and get back text extracted from the images

How do I update the definitions?
  • The api definition is defined in the proto file profile.proto

  • To update the proto service you need to run pre-commit command

    pre-commit run --all-files

    with that in place update the api appropriately updates

Documentation

Overview

Package ocrv1 is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var OCRService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "apis.OCRService",
	HandlerType: (*OCRServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Recognize",
			Handler:    _OCRService_Recognize_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _OCRService_Status_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "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 added in v1.2.1

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

MockOCRServiceClient is a mock of OCRServiceClient interface.

func NewMockOCRServiceClient added in v1.2.1

func NewMockOCRServiceClient(ctrl *gomock.Controller) *MockOCRServiceClient

NewMockOCRServiceClient creates a new mock instance.

func (*MockOCRServiceClient) EXPECT added in v1.2.1

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

func (*MockOCRServiceClient) Recognize added in v1.2.1

func (m *MockOCRServiceClient) Recognize(ctx context.Context, in *OcrRequest, opts ...grpc.CallOption) (*OcrResponse, error)

Recognize mocks base method.

func (*MockOCRServiceClient) Status added in v1.2.1

Status mocks base method.

type MockOCRServiceClientMockRecorder added in v1.2.1

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

MockOCRServiceClientMockRecorder is the mock recorder for MockOCRServiceClient.

func (*MockOCRServiceClientMockRecorder) Recognize added in v1.2.1

func (mr *MockOCRServiceClientMockRecorder) Recognize(ctx, in interface{}, opts ...interface{}) *gomock.Call

Recognize indicates an expected call of Recognize.

func (*MockOCRServiceClientMockRecorder) Status added in v1.2.1

func (mr *MockOCRServiceClientMockRecorder) Status(ctx, in interface{}, opts ...interface{}) *gomock.Call

Status indicates an expected call of Status.

type MockOCRServiceServer added in v1.2.1

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

MockOCRServiceServer is a mock of OCRServiceServer interface.

func NewMockOCRServiceServer added in v1.2.1

func NewMockOCRServiceServer(ctrl *gomock.Controller) *MockOCRServiceServer

NewMockOCRServiceServer creates a new mock instance.

func (*MockOCRServiceServer) EXPECT added in v1.2.1

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

func (*MockOCRServiceServer) Recognize added in v1.2.1

func (m *MockOCRServiceServer) Recognize(arg0 context.Context, arg1 *OcrRequest) (*OcrResponse, error)

Recognize mocks base method.

func (*MockOCRServiceServer) Status added in v1.2.1

Status mocks base method.

type MockOCRServiceServerMockRecorder added in v1.2.1

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

MockOCRServiceServerMockRecorder is the mock recorder for MockOCRServiceServer.

func (*MockOCRServiceServerMockRecorder) Recognize added in v1.2.1

func (mr *MockOCRServiceServerMockRecorder) Recognize(arg0, arg1 interface{}) *gomock.Call

Recognize indicates an expected call of Recognize.

func (*MockOCRServiceServerMockRecorder) Status added in v1.2.1

func (mr *MockOCRServiceServerMockRecorder) Status(arg0, arg1 interface{}) *gomock.Call

Status indicates an expected call of Status.

type MockUnsafeOCRServiceServer added in v1.2.1

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

MockUnsafeOCRServiceServer is a mock of UnsafeOCRServiceServer interface.

func NewMockUnsafeOCRServiceServer added in v1.2.1

func NewMockUnsafeOCRServiceServer(ctrl *gomock.Controller) *MockUnsafeOCRServiceServer

NewMockUnsafeOCRServiceServer creates a new mock instance.

func (*MockUnsafeOCRServiceServer) EXPECT added in v1.2.1

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

type MockUnsafeOCRServiceServerMockRecorder added in v1.2.1

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

MockUnsafeOCRServiceServerMockRecorder is the mock recorder for MockUnsafeOCRServiceServer.

type OCRClient

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

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 NewOCRClient

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

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

func (*OCRClient) Close

func (pc *OCRClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*OCRClient) Recognize

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

func (*OCRClient) StatusCheck

func (pc *OCRClient) StatusCheck(ctx context.Context, id string) (*OcrResponse, 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     common.STATUS     `protobuf:"varint,3,opt,name=status,proto3,enum=apis.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 added in v1.2.0

func (x *OCRFile) GetStatus() common.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

func (*OCRFile) Validate

func (m *OCRFile) Validate() error

Validate checks the field values on OCRFile with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type OCRFileValidationError

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

OCRFileValidationError is the validation error returned by OCRFile.Validate if the designated constraints aren't met.

func (OCRFileValidationError) Cause

func (e OCRFileValidationError) Cause() error

Cause function returns cause value.

func (OCRFileValidationError) Error

func (e OCRFileValidationError) Error() string

Error satisfies the builtin error interface

func (OCRFileValidationError) ErrorName

func (e OCRFileValidationError) ErrorName() string

ErrorName returns error name.

func (OCRFileValidationError) Field

func (e OCRFileValidationError) Field() string

Field function returns field value.

func (OCRFileValidationError) Key

func (e OCRFileValidationError) Key() bool

Key function returns key value.

func (OCRFileValidationError) Reason

func (e OCRFileValidationError) Reason() string

Reason function returns reason value.

type OCRServiceClient

type OCRServiceClient interface {
	// Perform a new ocr process request
	Recognize(ctx context.Context, in *OcrRequest, opts ...grpc.CallOption) (*OcrResponse, error)
	// Check the status of request if queued
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*OcrResponse, 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, *OcrRequest) (*OcrResponse, error)
	// Check the status of request if queued
	Status(context.Context, *StatusRequest) (*OcrResponse, error)
	// contains filtered or unexported methods
}

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

type OcrRequest

type OcrRequest 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 (*OcrRequest) Descriptor deprecated

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

Deprecated: Use OcrRequest.ProtoReflect.Descriptor instead.

func (*OcrRequest) GetAsync

func (x *OcrRequest) GetAsync() bool

func (*OcrRequest) GetFileId

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

func (*OcrRequest) GetLanguageId

func (x *OcrRequest) GetLanguageId() string

func (*OcrRequest) GetProperties

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

func (*OcrRequest) GetReferenceId

func (x *OcrRequest) GetReferenceId() string

func (*OcrRequest) ProtoMessage

func (*OcrRequest) ProtoMessage()

func (*OcrRequest) ProtoReflect

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

func (*OcrRequest) Reset

func (x *OcrRequest) Reset()

func (*OcrRequest) String

func (x *OcrRequest) String() string

func (*OcrRequest) Validate

func (m *OcrRequest) Validate() error

Validate checks the field values on OcrRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type OcrRequestValidationError

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

OcrRequestValidationError is the validation error returned by OcrRequest.Validate if the designated constraints aren't met.

func (OcrRequestValidationError) Cause

func (e OcrRequestValidationError) Cause() error

Cause function returns cause value.

func (OcrRequestValidationError) Error

Error satisfies the builtin error interface

func (OcrRequestValidationError) ErrorName

func (e OcrRequestValidationError) ErrorName() string

ErrorName returns error name.

func (OcrRequestValidationError) Field

Field function returns field value.

func (OcrRequestValidationError) Key

Key function returns key value.

func (OcrRequestValidationError) Reason

func (e OcrRequestValidationError) Reason() string

Reason function returns reason value.

type OcrResponse

type OcrResponse 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 (*OcrResponse) Descriptor deprecated

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

Deprecated: Use OcrResponse.ProtoReflect.Descriptor instead.

func (*OcrResponse) GetReferenceId

func (x *OcrResponse) GetReferenceId() string

func (*OcrResponse) GetResult

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

func (*OcrResponse) ProtoMessage

func (*OcrResponse) ProtoMessage()

func (*OcrResponse) ProtoReflect

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

func (*OcrResponse) Reset

func (x *OcrResponse) Reset()

func (*OcrResponse) String

func (x *OcrResponse) String() string

func (*OcrResponse) Validate

func (m *OcrResponse) Validate() error

Validate checks the field values on OcrResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type OcrResponseValidationError

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

OcrResponseValidationError is the validation error returned by OcrResponse.Validate if the designated constraints aren't met.

func (OcrResponseValidationError) Cause

Cause function returns cause value.

func (OcrResponseValidationError) Error

Error satisfies the builtin error interface

func (OcrResponseValidationError) ErrorName

func (e OcrResponseValidationError) ErrorName() string

ErrorName returns error name.

func (OcrResponseValidationError) Field

Field function returns field value.

func (OcrResponseValidationError) Key

Key function returns key value.

func (OcrResponseValidationError) Reason

Reason function returns reason value.

type StatusRequest

type StatusRequest struct {
	ReferenceId string `protobuf:"bytes,1,opt,name=reference_id,json=referenceId,proto3" json:"reference_id,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusRequest) Descriptor deprecated

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

Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.

func (*StatusRequest) GetReferenceId

func (x *StatusRequest) GetReferenceId() 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

func (*StatusRequest) Validate

func (m *StatusRequest) Validate() error

Validate checks the field values on StatusRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type StatusRequestValidationError

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

StatusRequestValidationError is the validation error returned by StatusRequest.Validate if the designated constraints aren't met.

func (StatusRequestValidationError) Cause

Cause function returns cause value.

func (StatusRequestValidationError) Error

Error satisfies the builtin error interface

func (StatusRequestValidationError) ErrorName

func (e StatusRequestValidationError) ErrorName() string

ErrorName returns error name.

func (StatusRequestValidationError) Field

Field function returns field value.

func (StatusRequestValidationError) Key

Key function returns key value.

func (StatusRequestValidationError) Reason

Reason function returns reason value.

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