pkg

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobClient

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

func NewJobClient

func NewJobClient(sess *session.Session, tableName string) *JobClient

func (*JobClient) CreateJob

func (c *JobClient) CreateJob(job TextractJob) error

func (*JobClient) GetJob

func (c *JobClient) GetJob(jobID string) (*TextractJob, error)

func (*JobClient) ListJobs

func (c *JobClient) ListJobs(opts ListJobsOptions) ([]TextractJob, error)

func (*JobClient) UpdateJobStatus

func (c *JobClient) UpdateJobStatus(jobID string, status string, errorMsg string) error

type ListJobsOptions

type ListJobsOptions struct {
	Since  *time.Time
	Status string
}

type ListObjectsOptions

type ListObjectsOptions struct {
	Recursive bool
	FromDate  *time.Time
	ToDate    *time.Time
	Prefix    string
}

type S3Client

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

func NewS3Client

func NewS3Client(ctx context.Context) (*S3Client, error)

func (*S3Client) ListObjects

func (c *S3Client) ListObjects(ctx context.Context, bucket string, opts ListObjectsOptions) ([]types.Object, error)

type StateLoader

type StateLoader struct {
}

StateLoader handles loading Textractor state from various sources

func NewStateLoader

func NewStateLoader() *StateLoader

NewStateLoader creates a new StateLoader

func (*StateLoader) LoadState

func (s *StateLoader) LoadState(tfDir, configFile string) (*TextractorResources, error)

LoadState loads the Textractor state from either config file or Terraform state

func (*StateLoader) LoadStateFromCommand

func (s *StateLoader) LoadStateFromCommand(cmd *cobra.Command) (*TextractorResources, error)

LoadStateFromCommand loads the Textractor state using flags from the given command

type TextractJob

type TextractJob struct {
	JobID       string     `json:"job_id" dynamodbav:"JobID"`
	DocumentKey string     `json:"document_key" dynamodbav:"DocumentKey"`
	Status      string     `json:"status" dynamodbav:"Status"`
	SubmittedAt time.Time  `json:"submitted_at" dynamodbav:"SubmittedAt"`
	CompletedAt *time.Time `json:"completed_at,omitempty" dynamodbav:"CompletedAt,omitempty"`
	TextractID  string     `json:"textract_id" dynamodbav:"TextractID"`
	ResultKey   string     `json:"result_key" dynamodbav:"ResultKey"`
	Error       string     `json:"error,omitempty" dynamodbav:"Error,omitempty"`
}

TextractJob represents a Textract processing job

type TextractorResources

type TextractorResources struct {
	DocumentS3Bucket            string `json:"document_bucket"`
	DocumentS3BucketARN         string `json:"document_bucket_arn"`
	OutputS3Bucket              string `json:"output_bucket"`
	OutputS3BucketARN           string `json:"output_bucket_arn"`
	InputQueue                  string `json:"input_queue_url"`
	CompletionQueue             string `json:"completion_queue_url"`
	NotificationsQueue          string `json:"notifications_queue_url"`
	SNSTopic                    string `json:"sns_topic_arn"`
	DocumentProcessorARN        string `json:"document_processor_arn"`
	DocumentProcessorName       string `json:"document_processor_name"`
	DocumentProcessorLogGroup   string `json:"document_processor_log_group"`
	CompletionProcessorARN      string `json:"completion_processor_arn"`
	CompletionProcessorName     string `json:"completion_processor_name"`
	CompletionProcessorLogGroup string `json:"completion_processor_log_group"`
	Region                      string `json:"region"`
	JobsTable                   string `json:"jobs_table_name"`
	CloudTrailLogGroup          string `json:"cloudtrail_log_group"`
	InputDLQURL                 string `json:"input_dlq_url"`
	CompletionDLQURL            string `json:"completion_dlq_url"`
	NotificationTopic           string `json:"notification_topic_arn"`
}

TextractorResources represents all AWS resources needed for the Textractor application

Directories

Path Synopsis
textract

Jump to

Keyboard shortcuts

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