source

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(sources ...iter.Seq2[SourceFile, error]) iter.Seq2[SourceFile, error]

Chain concatenates multiple sources into one sequential sequence.

func DirSource

func DirSource(root string, opts DirOpts) iter.Seq2[SourceFile, error]

DirSource yields SourceFiles for all files under root, applying opts. If opts.MaxDepth == 1, only direct children are yielded (non-recursive).

func FileSource

func FileSource(path string) iter.Seq2[SourceFile, error]

FileSource yields a single SourceFile for path, detecting its format.

func FileSourceWithFormat

func FileSourceWithFormat(path, formatID string) iter.Seq2[SourceFile, error]

FileSourceWithFormat yields a single SourceFile using the given format ID.

func GlobSource

func GlobSource(pattern string) iter.Seq2[SourceFile, error]

GlobSource yields SourceFiles for all paths matching pattern.

func StdinSource

func StdinSource(formatID string) iter.Seq2[SourceFile, error]

StdinSource reads stdin into a temporary file and yields it with the given format. The caller must call sf.Close() after use to remove the temp file.

Types

type DirOpts

type DirOpts struct {
	MaxDepth     int      // 0 = unlimited
	IncludeGlobs []string // only include matching basenames; empty = include all
	ExcludeGlobs []string // exclude matching basenames
	MinSize      int64    // bytes; 0 = no minimum
	MaxSize      int64    // bytes; 0 = no maximum
}

DirOpts configures DirSource behaviour.

type SourceFile

type SourceFile struct {
	Path    string
	Format  string // canonical format ID, e.g. "docx", "mp4"
	Size    int64
	ModTime time.Time
	// contains filtered or unexported fields
}

SourceFile represents a resolved input file ready for conversion.

func (SourceFile) Close

func (sf SourceFile) Close()

Close runs the cleanup function if set. Safe to call on zero value.

Jump to

Keyboard shortcuts

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