Versions in this module Expand all Collapse all v0 v0.55.0 May 4, 2024 v0.54.0 Apr 4, 2024 Changes in this version + const DatasetModeCOLUMNS + const DatasetModeMATRIX + const DatasetModeROWS + const DefDatasetMode + const DefEOL + const DefEscape + const DefOutput + const DefSeparator + const DefaultMaxRows + const DefaultRejected + const EReadEOF + const EReadLine + const EReadMissLeftQuote + const EReadMissRightQuote + const EReadMissSeparator + const ETypeConversion + var ErrMissRecordsLen = errors.New("dsv: Mismatch between number of record in row and columns length") + var ErrNilReader = errors.New("dsv: Reader object is nil") + var ErrNoInput = errors.New("dsv: No input file is given in config") + var ErrNoOutput = errors.New("dsv: No output file is given in config") + var ErrNotOpen = errors.New("dsv: Output file is not opened") + func ConfigCheckPath(comin ConfigInterface, file string) string + func ConfigOpen(rw interface{}, fcfg string) error + func ConfigParse(rw interface{}, cfg []byte) error + func InitWriter(writer WriterInterface) error + func OpenWriter(writer WriterInterface, fcfg string) (e error) + func Read(reader ReaderInterface) (n int, e error) + func SimpleWrite(reader ReaderInterface, fcfg string) (nrows int, e error) + type Config struct + ConfigPath string + func (cfg *Config) GetConfigPath() string + func (cfg *Config) SetConfigPath(dir string) + type ConfigInterface interface + GetConfigPath func() string + SetConfigPath func(dir string) + type Metadata struct + LeftQuote string + Name string + RightQuote string + Separator string + Skip bool + T int + Type string + ValueSpace []string + func NewMetadata(name, tipe, sep, leftq, rightq string, vs []string) (md *Metadata) + func (md *Metadata) GetLeftQuote() string + func (md *Metadata) GetName() string + func (md *Metadata) GetRightQuote() string + func (md *Metadata) GetSeparator() string + func (md *Metadata) GetSkip() bool + func (md *Metadata) GetType() int + func (md *Metadata) GetTypeName() string + func (md *Metadata) GetValueSpace() []string + func (md *Metadata) Init() + func (md *Metadata) IsEqual(o MetadataInterface) bool + func (md *Metadata) String() string + type MetadataInterface interface + GetLeftQuote func() string + GetName func() string + GetRightQuote func() string + GetSeparator func() string + GetSkip func() bool + GetType func() int + GetTypeName func() string + GetValueSpace func() []string + Init func() + IsEqual func(MetadataInterface) bool + func FindMetadata(mdin MetadataInterface, mds []MetadataInterface) (idx int, mdout MetadataInterface) + type ReadWriter struct + func New(config string, dataset interface{}) (rw *ReadWriter, e error) + func (dsv *ReadWriter) Close() (e error) + func (dsv *ReadWriter) SetConfigPath(dir string) + type Reader struct + DatasetMode string + Input string + InputMetadata []Metadata + MaxRows int + Rejected string + Skip int + TrimSpace bool + func NewReader(config string, dataset interface{}) (reader *Reader, e error) + func (reader *Reader) AddInputMetadata(md *Metadata) + func (reader *Reader) AppendMetadata(mdi MetadataInterface) + func (reader *Reader) Close() (e error) + func (reader *Reader) CopyConfig(src *Reader) + func (reader *Reader) FetchNextLine(lastline []byte) (line []byte, e error) + func (reader *Reader) Flush() error + func (reader *Reader) GetDataset() interface{} + func (reader *Reader) GetDatasetMode() string + func (reader *Reader) GetInput() string + func (reader *Reader) GetInputMetadata() []MetadataInterface + func (reader *Reader) GetInputMetadataAt(idx int) MetadataInterface + func (reader *Reader) GetMaxRows() int + func (reader *Reader) GetNColumnIn() int + func (reader *Reader) GetRejected() string + func (reader *Reader) GetSkip() int + func (reader *Reader) Init(fcfg string, dataset interface{}) (e error) + func (reader *Reader) IsEqual(other *Reader) bool + func (reader *Reader) IsTrimSpace() bool + func (reader *Reader) MergeColumns(other ReaderInterface) + func (reader *Reader) MergeRows(other *Reader) + func (reader *Reader) Open() (e error) + func (reader *Reader) OpenInput() (e error) + func (reader *Reader) OpenRejected() (e error) + func (reader *Reader) ReadLine() (line []byte, e error) + func (reader *Reader) Reject(line []byte) (int, error) + func (reader *Reader) Reset() (e error) + func (reader *Reader) SetDatasetMode(mode string) + func (reader *Reader) SetDefault() + func (reader *Reader) SetInput(path string) + func (reader *Reader) SetMaxRows(max int) + func (reader *Reader) SetRejected(path string) + func (reader *Reader) SetSkip(n int) + func (reader *Reader) SkipLines() (e error) + type ReaderError struct + Func string + Line string + N int + Pos int + T int + What string + func ParseLine(reader ReaderInterface, line []byte) (prow *tabula.Row, eRead *ReaderError) + func ReadRow(reader ReaderInterface, linenum int) (row *tabula.Row, line []byte, n int, eRead *ReaderError) + func (e *ReaderError) Error() string + type ReaderInterface interface + AddInputMetadata func(*Metadata) + AppendMetadata func(MetadataInterface) + Close func() error + FetchNextLine func([]byte) ([]byte, error) + Flush func() error + GetDataset func() interface{} + GetDatasetMode func() string + GetInput func() string + GetInputMetadata func() []MetadataInterface + GetInputMetadataAt func(idx int) MetadataInterface + GetMaxRows func() int + GetNColumnIn func() int + GetRejected func() string + GetSkip func() int + IsTrimSpace func() bool + MergeColumns func(ReaderInterface) + OpenInput func() error + OpenRejected func() error + ReadLine func() ([]byte, error) + Reject func(line []byte) (int, error) + Reset func() error + SetDatasetMode func(mode string) + SetDefault func() + SetInput func(path string) + SetMaxRows func(max int) + SetRejected func(path string) + SetSkip func(n int) + SkipLines func() error + func SimpleMerge(fin1, fin2 string, dataset1, dataset2 interface{}) (ReaderInterface, error) + func SimpleRead(fcfg string, dataset interface{}) (reader ReaderInterface, e error) + type Writer struct + BufWriter *bufio.Writer + Output string + OutputMetadata []Metadata + func NewWriter(config string) (writer *Writer, e error) + func (writer *Writer) AddMetadata(md Metadata) + func (writer *Writer) Close() (e error) + func (writer *Writer) Flush() error + func (writer *Writer) GetOutput() string + func (writer *Writer) OpenOutput(file string) (e error) + func (writer *Writer) ReopenOutput(file string) (e error) + func (writer *Writer) SetOutput(path string) + func (writer *Writer) String() string + func (writer *Writer) Write(reader ReaderInterface) (int, error) + func (writer *Writer) WriteColumns(columns tabula.Columns, colMd []MetadataInterface) (n int, e error) + func (writer *Writer) WriteRawColumns(cols *tabula.Columns, sep *string) (nrow int, e error) + func (writer *Writer) WriteRawDataset(dataset tabula.DatasetInterface, sep *string) (int, error) + func (writer *Writer) WriteRawRow(row *tabula.Row, sep, esc []byte) (e error) + func (writer *Writer) WriteRawRows(rows *tabula.Rows, sep *string) (nrow int, e error) + func (writer *Writer) WriteRow(row *tabula.Row, recordMd []MetadataInterface) (e error) + func (writer *Writer) WriteRows(rows tabula.Rows, recordMd []MetadataInterface) (n int, e error) + type WriterInterface interface + Close func() error + Flush func() error + GetOutput func() string + OpenOutput func(file string) error + SetOutput func(path string)