Documentation
¶
Index ¶
- func CleanupDecompressedFiles(files []DecompressedFileInfo)
- func DecompressFile(filePath string) (string, error)
- func DetectFormatsFromFiles(files []string) (map[string]Format, error)
- func GetUncompressedPath(filePath string) string
- func GroupFilesByFormat(files []string) (map[Format][]string, error)
- func IsCompressed(filePath string) bool
- func IsFormatSupported(format string) bool
- func IsMQURL(urlStr string) bool
- type Compression
- type DecompressedFileInfo
- type FileHandler
- type Format
- type HandlerFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupDecompressedFiles ¶ added in v1.0.1
func CleanupDecompressedFiles(files []DecompressedFileInfo)
CleanupDecompressedFiles removes temporary decompressed files
func DecompressFile ¶ added in v1.0.1
DecompressFile decompresses a file to a temporary file and returns the temp file path The caller is responsible for cleaning up the temp file
func DetectFormatsFromFiles ¶ added in v1.0.1
DetectFormatsFromFiles returns a map of file path to format for each file
func GetUncompressedPath ¶ added in v1.0.1
GetUncompressedPath returns the path without the compression extension e.g., "data.csv.gz" -> "data.csv"
func GroupFilesByFormat ¶ added in v1.0.1
GroupFilesByFormat groups files by their format
func IsCompressed ¶ added in v1.0.1
IsCompressed checks if a file path has a compression extension
func IsFormatSupported ¶
IsFormatSupported checks if a format is supported
Types ¶
type Compression ¶ added in v1.0.1
type Compression string
Compression represents a supported compression format
const ( CompressionNone Compression = "" CompressionGzip Compression = "gzip" CompressionBzip2 Compression = "bzip2" CompressionXZ Compression = "xz" CompressionZstd Compression = "zstd" )
func DetectCompression ¶ added in v1.0.1
func DetectCompression(filePath string) Compression
DetectCompression detects if a file is compressed and returns the compression type
type DecompressedFileInfo ¶ added in v1.0.1
type DecompressedFileInfo struct {
OriginalPath string
DecompressPath string
WasCompressed bool
Format Format
}
DecompressedFileInfo holds information about a decompressed file
func DecompressFiles ¶ added in v1.0.1
func DecompressFiles(files []string) ([]DecompressedFileInfo, error)
DecompressFiles decompresses all compressed files in the list Returns a list of DecompressedFileInfo with paths to the decompressed files
type FileHandler ¶
type Format ¶
type Format string
Format represents a supported file format
const ( FormatCSV Format = "csv" FormatJSON Format = "json" FormatJSONL Format = "jsonl" FormatXML Format = "xml" FormatExcel Format = "excel" FormatParquet Format = "parquet" FormatYAML Format = "yaml" FormatAVRO Format = "avro" FormatORC Format = "orc" FormatPostgres Format = "postgres" FormatMySQL Format = "mysql" FormatDuckDB Format = "duckdb" FormatMongoDB Format = "mongodb" FormatDynamoDB Format = "dynamodb" FormatSQLite Format = "sqlite" FormatMQ Format = "mq" // Message Queue (SQS, Kafka, RabbitMQ, etc.) FormatMixed Format = "mixed" // Mixed file formats (for JOINs across different formats) )
func DetectFormat ¶
DetectFormat detects the file format from file extension or URL scheme
func DetectFormatFromFiles ¶
DetectFormatFromFiles detects the format from a list of files If all files have the same format, returns that format If files have mixed formats, returns FormatMixed
func GetInnerFormat ¶ added in v1.0.1
GetInnerFormat detects the format of a compressed file e.g., "data.csv.gz" -> FormatCSV
func SupportedFormats ¶
func SupportedFormats() []Format
SupportedFormats returns a list of supported file formats
type HandlerFactory ¶
type HandlerFactory struct {
// contains filtered or unexported fields
}
HandlerFactory creates file handlers based on format
func NewHandlerFactory ¶
func NewHandlerFactory(storage storage.Storage, bar *progressbar.ProgressBar, limitLines int, collection string, delimiter rune) *HandlerFactory
NewHandlerFactory creates a new handler factory
Directories
¶
| Path | Synopsis |
|---|---|
|
Package composite provides a file handler that can process multiple files of different formats
|
Package composite provides a file handler that can process multiple files of different formats |
|
Package mq provides a FileHandler implementation for message queue sources.
|
Package mq provides a FileHandler implementation for message queue sources. |