Documentation
¶
Index ¶
- func Chain(sources ...iter.Seq2[SourceFile, error]) iter.Seq2[SourceFile, error]
- func DirSource(root string, opts DirOpts) iter.Seq2[SourceFile, error]
- func FileSource(path string) iter.Seq2[SourceFile, error]
- func FileSourceWithFormat(path, formatID string) iter.Seq2[SourceFile, error]
- func GlobSource(pattern string) iter.Seq2[SourceFile, error]
- func StdinSource(formatID string) iter.Seq2[SourceFile, error]
- type DirOpts
- type SourceFile
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 ¶
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.