json

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package json implements the sq driver for JSON. There are three supported types: - JSON: plain old JSON - JSONA: JSON Array, where each record is an array of JSON values on its own line. - JSONL: JSON Lines, where each record a JSON object on its own line.

Index

Constants

View Source
const (
	// TypeJSON is the plain-old JSON driver type.
	TypeJSON = source.DriverType("json")

	// TypeJSONA is the JSON Array driver type.
	TypeJSONA = source.DriverType("jsona")

	// TypeJSONL is the JSON Lines driver type.
	TypeJSONL = source.DriverType("jsonl")
)

Variables

This section is empty.

Functions

func DetectJSON

func DetectJSON(sampleSize int) source.DriverDetectFunc

DetectJSON returns a source.DriverDetectFunc that can detect JSON.

func DetectJSONA

func DetectJSONA(sampleSize int) source.DriverDetectFunc

DetectJSONA returns a source.DriverDetectFunc for TypeJSONA. Each line of input must be a valid JSON array.

func DetectJSONL

func DetectJSONL(sampleSize int) source.DriverDetectFunc

DetectJSONL returns a source.DriverDetectFunc that can detect JSONL.

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.DriverType) (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