filehandler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFormatSupported

func IsFormatSupported(format string) bool

IsFormatSupported checks if a format is supported

Types

type FileHandler

type FileHandler interface {
	Import() error
	Lines() int
	Close() error
}

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"
	FormatSQLite   Format = "sqlite"
)

func DetectFormat

func DetectFormat(filePath string) (Format, error)

DetectFormat detects the file format from file extension or URL scheme

func DetectFormatFromFiles

func DetectFormatFromFiles(files []string) (Format, error)

DetectFormatFromFiles detects the format from a list of files Returns error if files have mixed formats

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

Jump to

Keyboard shortcuts

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