csv

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package csv implements the sq driver for CSV/TSV et al.

Index

Constants

View Source
const (
	// TypeCSV is the CSV driver type.
	TypeCSV = source.Type("csv")

	// TypeTSV is the TSV driver type.
	TypeTSV = source.Type("tsv")
)

Variables

This section is empty.

Functions

func DetectCSV

func DetectCSV(ctx context.Context, openFn source.FileOpenFunc) (detected source.Type, score float32,
	err error,
)

DetectCSV implements source.TypeDetectFunc.

func DetectTSV

func DetectTSV(ctx context.Context, openFn source.FileOpenFunc) (detected source.Type,
	score float32, err error,
)

DetectTSV implements source.TypeDetectFunc.

func Hash added in v0.32.0

func Hash(detectors []*kind.Detector) (h string, err error)

Hash generates a hash from the kinds returned by the detectors. The detectors should already have sampled data.

TODO: move Hash to pkg libsq/core/kind?

Types

type Provider

type Provider struct {
	Log       *slog.Logger
	Scratcher driver.ScratchDatabaseOpener
	Files     *source.Files
}

Provider implements driver.Provider.

func (*Provider) DriverFor

func (d *Provider) DriverFor(typ source.Type) (driver.Driver, error)

DriverFor implements driver.Provider.

Jump to

Keyboard shortcuts

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