streaming

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationEvent

type AnnotationEvent struct {
	PageIndex int
	Ref       raw.ObjectRef
	Subtype   string
}

AnnotationEvent reports an annotation present on a page.

func (AnnotationEvent) Type

func (AnnotationEvent) Type() EventType

type ContentOperationEvent

type ContentOperationEvent struct {
	PageIndex int
	Operation semantic.Operation
}

ContentOperationEvent emits a single decoded content operation.

func (ContentOperationEvent) Type

type Context

type Context interface{ Done() <-chan struct{} }

type DocumentEndEvent

type DocumentEndEvent struct{}

func (DocumentEndEvent) Type

func (DocumentEndEvent) Type() EventType

type DocumentStartEvent

type DocumentStartEvent struct {
	Version   string
	Encrypted bool
}

func (DocumentStartEvent) Type

type DocumentStream

type DocumentStream interface {
	Events() <-chan Event
	Errors() <-chan error
	Close() error
}

type Event

type Event interface{ Type() EventType }

type EventType

type EventType int
const (
	EventDocumentStart EventType = iota
	EventDocumentEnd
	EventPageStart
	EventPageEnd
	EventContentOperation
	EventResourceRef
	EventAnnotation
	EventMetadata
)

type InlineImage

type InlineImage struct {
	Dict semantic.DictOperand
	Data []byte
}

InlineImage represents BI/ID/EI inline image segments parsed from content streams. It is retained for potential consumers even though no dedicated event type is emitted.

type MetadataEvent

type MetadataEvent struct {
	Info raw.DocumentMetadata
}

MetadataEvent emits document-level metadata.

func (MetadataEvent) Type

func (MetadataEvent) Type() EventType

type PageEndEvent

type PageEndEvent struct{ Index int }

PageEndEvent marks the end of a page.

func (PageEndEvent) Type

func (PageEndEvent) Type() EventType

type PageStartEvent

type PageStartEvent struct {
	Index    int
	MediaBox semantic.Rectangle
}

PageStartEvent marks the beginning of a page and carries basic geometry.

func (PageStartEvent) Type

func (PageStartEvent) Type() EventType

type Parser

type Parser interface {
	Stream(ctx Context, r ReaderAt, cfg StreamConfig) (DocumentStream, error)
}

func NewParser

func NewParser() Parser

NewParser constructs a streaming parser that emits document boundary events.

type ReaderAt

type ReaderAt interface {
	ReadAt(p []byte, off int64) (n int, err error)
}

type ResourceRefEvent

type ResourceRefEvent struct {
	PageIndex int
	Kind      string
	Name      string
}

ResourceRefEvent reports a resource reference encountered on a page.

func (ResourceRefEvent) Type

func (ResourceRefEvent) Type() EventType

type StreamConfig

type StreamConfig struct {
	BufferSize  int
	ReadAhead   int
	Concurrency int
}

Jump to

Keyboard shortcuts

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