loader

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DOCXExtractor

type DOCXExtractor struct{}

DOCXExtractor handles .docx files using stdlib zip+xml — no external license required.

func (*DOCXExtractor) Load

func (d *DOCXExtractor) Load(path string) (string, error)

func (*DOCXExtractor) Supports

func (d *DOCXExtractor) Supports(ext string) bool

type Dispatcher

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

Dispatcher satisfies port.DocumentLoader by routing to the appropriate format-specific extractor based on file extension.

func New

func New() *Dispatcher

New returns a Dispatcher pre-loaded with all supported format extractors.

func (*Dispatcher) Load

func (d *Dispatcher) Load(path string) (string, error)

Load extracts plain text from the file at path. Returns an error if no extractor supports the file extension.

func (*Dispatcher) Supports

func (d *Dispatcher) Supports(ext string) bool

Supports returns true if any registered extractor supports the given extension.

type PDFExtractor

type PDFExtractor struct{}

PDFExtractor handles .pdf files.

func (*PDFExtractor) Load

func (p *PDFExtractor) Load(path string) (string, error)

func (*PDFExtractor) Supports

func (p *PDFExtractor) Supports(ext string) bool

type TextExtractor

type TextExtractor struct{}

TextExtractor handles .txt, .text, .md, and .markdown files.

func (*TextExtractor) Load

func (t *TextExtractor) Load(path string) (string, error)

func (*TextExtractor) Supports

func (t *TextExtractor) Supports(ext string) bool

Jump to

Keyboard shortcuts

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