docfactory

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlienationErr error = errors.New("don't know who I am")

AlienationErr indicates that forking a new process is not possible because TES could not find out its own FS path (this is unlikely)

Functions

This section is empty.

Types

type DocFactory

type DocFactory struct {
	MaxInMemoryBytes uint64
	MaxFileSizeBytes uint64
	// contains filtered or unexported fields
}

func New

func New(tesconfig *config.TesConfig, logger *slog.Logger) *DocFactory

func (*DocFactory) NewDocFromForkedProcess

func (df *DocFactory) NewDocFromForkedProcess(r io.Reader, origin string) (*ForkedDoc, error)

NewDocFromForkedProcess creates a Document whose content and metadata is being extracted by a forked subprocess

func (*DocFactory) NewDocFromForkedProcessPath

func (df *DocFactory) NewDocFromForkedProcessPath(path, origin string) (*ForkedDoc, error)

func (*DocFactory) NewDocFromStream

func (df *DocFactory) NewDocFromStream(r io.Reader, size int64, origin string) (cache.Document, error)

func (*DocFactory) NewFromBytes

func (df *DocFactory) NewFromBytes(data []byte, origin string) (cache.Document, error)

func (*DocFactory) NewFromPath

func (df *DocFactory) NewFromPath(path, origin string) (cache.Document, error)

func (*DocFactory) NewPdfFromBytes

func (df *DocFactory) NewPdfFromBytes(data []byte, origin string) (doc cache.Document, err error)

NewPdfFromBytes returns a PDF Document parsed by the particular PDF lib that was loaded before

func (*DocFactory) NewPdfFromPath

func (df *DocFactory) NewPdfFromPath(path, origin string) (doc cache.Document, err error)

NewPdfFromPath returns a PDF Document parsed by the particular PDF lib that was loaded before

func (*DocFactory) PdfImpl

func (df *DocFactory) PdfImpl() pdfImplementation

type ForkedDoc

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

ForkedDoc represents a Document processed by forked subprocess of this service

func (*ForkedDoc) Close

func (d *ForkedDoc) Close()

func (*ForkedDoc) Data

func (d *ForkedDoc) Data() *[]byte

func (*ForkedDoc) HasNewlines added in v4.1.0

func (d *ForkedDoc) HasNewlines() bool

func (*ForkedDoc) MetadataMap

func (d *ForkedDoc) MetadataMap() map[string]string

func (*ForkedDoc) Pages

func (d *ForkedDoc) Pages() int

func (*ForkedDoc) Path

func (d *ForkedDoc) Path() string

func (*ForkedDoc) StreamText

func (d *ForkedDoc) StreamText(w io.Writer) error

StreamText may only be invoked once!

func (*ForkedDoc) Text

func (d *ForkedDoc) Text(i int) (string, bool)

type PooledDoc added in v4.1.0

type PooledDoc struct {
	cache.Document
	// contains filtered or unexported fields
}

func (*PooledDoc) Close added in v4.1.0

func (d *PooledDoc) Close()

func (*PooledDoc) HasNewlines added in v4.1.0

func (d *PooledDoc) HasNewlines() bool

Jump to

Keyboard shortcuts

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