ocr

package
v0.0.0-...-7559883 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GosseractClient

type GosseractClient interface {
	SetImageFromBytes(content []byte) error
	Text() (string, error)
	Close() error
}

GosseractClient is an interface matching the methods used by gosseract.Client

type OCRProcessor

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

OCRProcessor holds the OCR client and other related functionality

func NewOCRProcessor

func NewOCRProcessor(logger *log.Logger) *OCRProcessor

NewOCRProcessor initializes a new OCRProcessor

func (*OCRProcessor) Close

func (ocr *OCRProcessor) Close() error

Close closes any resources held by the OCRProcessor

func (*OCRProcessor) UploadHandler

func (ocr *OCRProcessor) UploadHandler(w http.ResponseWriter, r *http.Request, cfg conf.Config)

UploadHandler handles the file upload and text extraction

Jump to

Keyboard shortcuts

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