cbcsv

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotInReadMode  = errors.New("csv is not in read mode")
	ErrNotInWriteMode = errors.New("csv is not in write mode")
)

Functions

This section is empty.

Types

type ConcurrentWaitGroup

type ConcurrentWaitGroup interface {
	Add()
	Done()
	Wait()
}

type Csv

type Csv[T any] struct {
	// contains filtered or unexported fields
}

func NewCsv

func NewCsv[T any](opts ...CsvOption) (c *Csv[T], e error)

func (*Csv[T]) Close

func (c *Csv[T]) Close() (errs []error)

func (*Csv[T]) Range

func (c *Csv[T]) Range(fn func(offset int, item T) error, wg ConcurrentWaitGroup) error

func (*Csv[T]) Read

func (c *Csv[T]) Read() (T, error)

func (*Csv[T]) Write

func (c *Csv[T]) Write(item T) error

type CsvOption

type CsvOption func(o *csvOptions)

func WithAppendFile

func WithAppendFile() CsvOption

func WithFilePath

func WithFilePath(filePath string) CsvOption

func WithMissingHeader

func WithMissingHeader() CsvOption

func WithRead

func WithRead() CsvOption

func WithReader

func WithReader(reader io.ReadCloser) CsvOption

func WithSkipErrors added in v0.0.3

func WithSkipErrors() CsvOption

func WithSkipRows

func WithSkipRows(rows int) CsvOption

func WithTruncatedFile

func WithTruncatedFile() CsvOption

func WithWrite

func WithWrite() CsvOption

func WithWriter

func WithWriter(writer io.WriteCloser) CsvOption

Jump to

Keyboard shortcuts

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