pcsv

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]string, error)

Marshal struct to csv row([]string)

func Unmarshal

func Unmarshal(data []string, v interface{}) error

Unmarshal csv row([]string) to struct

Types

type PCsvReader

type PCsvReader struct {
	WithHeader      bool
	FieldsPerRecord int
	FilePaths       []string
	ReadingState    map[string]int // map[filepath]line
}

func NewPCsvReader

func NewPCsvReader(filePaths []string, withHeader bool) *PCsvReader

func (*PCsvReader) Read

func (pr *PCsvReader) Read(dataCh chan []string)

type PCsvWriter

type PCsvWriter struct {
	Lines      int
	FileNo     int
	CsvFile    *os.File
	MaxLines   int
	FilePrefix string
	OutputDir  string
	Title      []string
}

func NewPCsvWriter

func NewPCsvWriter(filePrefix, outputDir string) *PCsvWriter

func (*PCsvWriter) Write

func (pw *PCsvWriter) Write(dataCh chan []string)

Jump to

Keyboard shortcuts

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