csvw

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package csvw implements writers for CSV.

Index

Constants

View Source
const (
	// Tab is the tab rune.
	Tab = '\t'

	// Comma is the comma rune.
	Comma = ','
)

Variables

This section is empty.

Functions

func NewCommaDiffWriter added in v0.48.0

func NewCommaDiffWriter(pr *output.Printing) diff.RecordHunkWriter

NewCommaDiffWriter returns a diff.RecordHunkWriter for CSV.

func NewCommaRecordWriter added in v0.36.0

func NewCommaRecordWriter(out io.Writer, pr *output.Printing) output.RecordWriter

NewCommaRecordWriter returns writer instance that uses csvw.Comma.

func NewPingWriter

func NewPingWriter(out io.Writer, sep rune) output.PingWriter

NewPingWriter returns a new instance.

func NewTabDiffWriter added in v0.48.0

func NewTabDiffWriter(pr *output.Printing) diff.RecordHunkWriter

NewTabDiffWriter returns a diff.RecordHunkWriter for TSV.

func NewTabRecordWriter added in v0.36.0

func NewTabRecordWriter(out io.Writer, pr *output.Printing) output.RecordWriter

NewTabRecordWriter returns writer instance that uses csvw.Comma.

Types

type RecordWriter

type RecordWriter struct {
	// contains filtered or unexported fields
}

RecordWriter implements output.RecordWriter.

func (*RecordWriter) Close

func (w *RecordWriter) Close(context.Context) error

Close implements output.RecordWriter.

func (*RecordWriter) Flush

func (w *RecordWriter) Flush(context.Context) error

Flush implements output.RecordWriter.

func (*RecordWriter) Open

func (w *RecordWriter) Open(_ context.Context, recMeta record.Meta) error

Open implements output.RecordWriter.

func (*RecordWriter) SetComma added in v0.36.0

func (w *RecordWriter) SetComma(c rune)

SetComma sets the CSV writer comma value.

func (*RecordWriter) WriteRecords

func (w *RecordWriter) WriteRecords(ctx context.Context, recs []record.Record) error

WriteRecords implements output.RecordWriter.

Jump to

Keyboard shortcuts

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