textract

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 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 Block

type Block struct {
	BlockType     string             `json:"BlockType"`
	Id            string             `json:"Id"`
	Text          string             `json:"Text,omitempty"`
	Confidence    float64            `json:"Confidence"`
	Geometry      map[string]float64 `json:"Geometry,omitempty"`
	Relationships []map[string]any   `json:"Relationships,omitempty"`
	EntityTypes   []string           `json:"EntityTypes,omitempty"`
	Page          int                `json:"Page,omitempty"`
	RowIndex      int                `json:"RowIndex,omitempty"`
	ColumnIndex   int                `json:"ColumnIndex,omitempty"`
}

type ExpenseDocument

type ExpenseDocument struct {
	ExpenseIndex   int              `json:"ExpenseIndex"`
	SummaryFields  []map[string]any `json:"SummaryFields,omitempty"`
	LineItemGroups []map[string]any `json:"LineItemGroups,omitempty"`
}

type Job

type Job struct {
	JobId               string
	JobType             JobType
	Status              JobStatus
	DocumentLocation    map[string]any
	FeatureTypes        []string
	NotificationChannel map[string]any
	Blocks              []Block
	ExpenseDocuments    []ExpenseDocument
	CreationTime        time.Time
	CompletionTime      *time.Time
	StatusMessage       string
	Tags                map[string]string
	Lifecycle           *lifecycle.Machine
}

type JobStatus

type JobStatus string
const (
	JobInProgress JobStatus = "IN_PROGRESS"
	JobSucceeded  JobStatus = "SUCCEEDED"
	JobFailed     JobStatus = "FAILED"
)

type JobType

type JobType string
const (
	JobTextDetection   JobType = "TEXT_DETECTION"
	JobDocAnalysis     JobType = "DOCUMENT_ANALYSIS"
	JobExpenseAnalysis JobType = "EXPENSE_ANALYSIS"
)

type Store

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

func NewStore

func NewStore(accountID, region string) *Store

func (*Store) AnalyzeDocumentSync

func (s *Store) AnalyzeDocumentSync(document map[string]any, featureTypes []string) map[string]any

func (*Store) DetectDocumentTextSync

func (s *Store) DetectDocumentTextSync(document map[string]any) map[string]any

func (*Store) GetJob

func (s *Store) GetJob(jobId string) (*Job, *service.AWSError)

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) (map[string]string, *service.AWSError)

func (*Store) StartJob

func (s *Store) StartJob(jobType JobType, docLocation map[string]any, featureTypes []string, notifChannel map[string]any, tags map[string]string) *Job

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string) *service.AWSError

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, tagKeys []string) *service.AWSError

type TextractService

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

TextractService is the cloudmock implementation of the AWS Textract API.

func New

func New(accountID, region string) *TextractService

New returns a new TextractService for the given AWS account ID and region.

func (*TextractService) Actions

func (s *TextractService) Actions() []service.Action

Actions returns the list of Textract API actions supported by this service.

func (*TextractService) HandleRequest

func (s *TextractService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming Textract request to the appropriate handler. Textract uses JSON protocol with TargetPrefix "Textract".

func (*TextractService) HealthCheck

func (s *TextractService) HealthCheck() error

HealthCheck always returns nil.

func (*TextractService) Name

func (s *TextractService) Name() string

Name returns the AWS service name used for routing.

Jump to

Keyboard shortcuts

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