Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupChunks ¶
func CleanupChunks(result *ChunkResult) error
CleanupChunks removes the temporary directory and all chunk files
Types ¶
type ChunkConfig ¶
type ChunkConfig struct {
By string // How to split the file: "lines", "bytes", or "tokens"
Size int // Chunk size (e.g., 10000 lines)
Overlap int // Lines/bytes to overlap between chunks for context
MaxChunks int // Limit total chunks to prevent overload
}
ChunkConfig represents the configuration for chunking a large file
type ChunkResult ¶
type ChunkResult struct {
ChunkPaths []string // Paths to the temporary chunk files
TempDir string // Path to the temporary directory containing the chunks
TotalChunks int // Total number of chunks created
}
ChunkResult contains information about the chunking operation
func SplitFile ¶
func SplitFile(filePath string, config ChunkConfig) (*ChunkResult, error)
SplitFile splits a file into chunks based on the provided configuration It returns the paths to the temporary chunk files and a cleanup function
Click to show internal directories.
Click to hide internal directories.