Documentation
¶
Overview ¶
Package extract turns downloaded attachments into plain text for an automated reader. Images are refused on purpose: there is no OCR, the reader is expected to look at them directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLimits = Limits{MaxText: 200_000, MaxOutput: 64 << 20, MaxFileBytes: 50 << 20, MaxTotalBytes: 200 << 20, MaxEntries: 500, MaxDepth: 2}
DefaultLimits suit a chat attachment read by an agent.
var ErrImage = errors.New("image files have no text extraction (no OCR); download the file and view it")
ErrImage means the file is an image and has no text to extract.
Functions ¶
This section is empty.
Types ¶
type Limits ¶
type Limits struct {
MaxText int // bytes of text kept; the middle of longer text is cut
MaxOutput int64 // bytes of text produced before extraction stops
MaxFileBytes int64 // largest file, archive entry or document part read
MaxTotalBytes int64 // total uncompressed bytes read, archives and parts included
MaxEntries int // archive entries inspected
MaxDepth int // nested archives followed
}
Limits bound the work done on untrusted input.