Documentation
¶
Index ¶
- Variables
- type BMPParser
- type BMPParserResult
- type CompositeParser
- type CompositeParserResult
- type ErrMimeTypeNotSupported
- type GIFParser
- type GIFParserResult
- type JPEGParser
- type JPEGParserResult
- type PDFParser
- type PDFParserResult
- type PDFParserResultPage
- type PNGParser
- type PNGParserResult
- type Parser
- type Result
- type TiffParser
- type TiffParserResult
- type WebPParser
- type WebPParserResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadFile = errors.New("bad file or corrupted")
View Source
var ErrParserDisabled = errors.New("parser disabled")
Functions ¶
This section is empty.
Types ¶
type BMPParser ¶
type BMPParser struct {
// contains filtered or unexported fields
}
Parses `image/bmp` files
func NewBMPParser ¶
func (*BMPParser) SupportedMimeTypes ¶
type BMPParserResult ¶
func (*BMPParserResult) Componets ¶
func (r *BMPParserResult) Componets() []Result
func (*BMPParserResult) Error ¶
func (r *BMPParserResult) Error() error
func (*BMPParserResult) String ¶
func (r *BMPParserResult) String() string
type CompositeParser ¶
type CompositeParser struct {
// contains filtered or unexported fields
}
func NewCompositeParser ¶
func NewCompositeParser(parsers ...Parser) *CompositeParser
func (*CompositeParser) AddParsers ¶
func (p *CompositeParser) AddParsers(parsers ...Parser)
func (*CompositeParser) SupportedMimeTypes ¶
func (p *CompositeParser) SupportedMimeTypes() []string
type CompositeParserResult ¶
type CompositeParserResult struct { Err error `json:"error"` MimeType string `json:"mimeType"` Inner Result `json:"inner"` }
func (*CompositeParserResult) Componets ¶
func (r *CompositeParserResult) Componets() []Result
func (*CompositeParserResult) Error ¶
func (r *CompositeParserResult) Error() error
func (*CompositeParserResult) String ¶
func (r *CompositeParserResult) String() string
type ErrMimeTypeNotSupported ¶
func (*ErrMimeTypeNotSupported) Error ¶
func (e *ErrMimeTypeNotSupported) Error() string
type GIFParser ¶
type GIFParser struct {
// contains filtered or unexported fields
}
Parses `image/gif` files. Only decodes first frame
func NewGIFParser ¶
func (*GIFParser) SupportedMimeTypes ¶
type GIFParserResult ¶
func (*GIFParserResult) Componets ¶
func (r *GIFParserResult) Componets() []Result
func (*GIFParserResult) Error ¶
func (r *GIFParserResult) Error() error
func (*GIFParserResult) String ¶
func (r *GIFParserResult) String() string
type JPEGParser ¶
type JPEGParser struct {
// contains filtered or unexported fields
}
Parses `image/jpeg` files
func NewJPEGParser ¶
func NewJPEGParser(ocrProvider ocr.Provider) *JPEGParser
func (*JPEGParser) SupportedMimeTypes ¶
func (p *JPEGParser) SupportedMimeTypes() []string
type JPEGParserResult ¶
func (*JPEGParserResult) Componets ¶
func (r *JPEGParserResult) Componets() []Result
func (*JPEGParserResult) Error ¶
func (r *JPEGParserResult) Error() error
func (*JPEGParserResult) String ¶
func (r *JPEGParserResult) String() string
type PDFParser ¶
type PDFParser struct { }
Parses `application/pdf` files
func NewPDFParser ¶
func (*PDFParser) SupportedMimeTypes ¶
type PDFParserResult ¶
type PDFParserResult struct { Metadata string `json:"metadata"` Pages []PDFParserResultPage `json:"pages"` Err error `json:"error"` }
func (*PDFParserResult) Componets ¶
func (r *PDFParserResult) Componets() []Result
func (*PDFParserResult) Error ¶
func (r *PDFParserResult) Error() error
func (*PDFParserResult) String ¶
func (r *PDFParserResult) String() string
type PDFParserResultPage ¶
type PNGParser ¶
type PNGParser struct {
// contains filtered or unexported fields
}
Parses `image/png` files
func NewPNGParser ¶
func (*PNGParser) SupportedMimeTypes ¶
type PNGParserResult ¶
func (*PNGParserResult) Componets ¶
func (r *PNGParserResult) Componets() []Result
func (*PNGParserResult) Error ¶
func (r *PNGParserResult) Error() error
func (*PNGParserResult) String ¶
func (r *PNGParserResult) String() string
type Parser ¶
type Result ¶
type Result interface { // Convert entire result to LLM readable string String() string // Not empty if there where error Error() error // Parsed subcomponents. For example images in the PDF or files inside archives Componets() []Result }
Parsing result
type TiffParser ¶
type TiffParser struct {
// contains filtered or unexported fields
}
Parses `image/tiff` files
func NewTiffParser ¶
func NewTiffParser(ocrProvider ocr.Provider) *TiffParser
func (*TiffParser) SupportedMimeTypes ¶
func (p *TiffParser) SupportedMimeTypes() []string
type TiffParserResult ¶
func (*TiffParserResult) Componets ¶
func (r *TiffParserResult) Componets() []Result
func (*TiffParserResult) Error ¶
func (r *TiffParserResult) Error() error
func (*TiffParserResult) String ¶
func (r *TiffParserResult) String() string
type WebPParser ¶
type WebPParser struct {
// contains filtered or unexported fields
}
Parses `image/webp` files
func NewWebPParser ¶
func NewWebPParser(ocrProvider ocr.Provider) *WebPParser
func (*WebPParser) SupportedMimeTypes ¶
func (p *WebPParser) SupportedMimeTypes() []string
type WebPParserResult ¶
func (*WebPParserResult) Componets ¶
func (r *WebPParserResult) Componets() []Result
func (*WebPParserResult) Error ¶
func (r *WebPParserResult) Error() error
func (*WebPParserResult) String ¶
func (r *WebPParserResult) String() string
Click to show internal directories.
Click to hide internal directories.