Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LazyReader ¶
type LazyReader struct {
Init InitFunc
// contains filtered or unexported fields
}
LazyReader allows delayed opening of a resource. It can be used to delay opening a resource until the resource is actually read.
func (*LazyReader) Read ¶
func (r *LazyReader) Read() (record []string, err error)
Read calls Read func from reader that will be returned by InitFunc.
type MultiReader ¶
type MultiReader struct {
// contains filtered or unexported fields
}
MultiReader is the logical concatenation of the provided input readers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readers return a non-nil, non-EOF error, Read will return that error.
func NewReader ¶
func NewReader(readers ...Reader) *MultiReader
NewReader returns a Reader that's the logical concatenation of the provided input readers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readers return a non-nil, non-EOF error, Read will return that error.
func (*MultiReader) Read ¶
func (mr *MultiReader) Read() (record []string, err error)
Read reads one record (a slice of fields) from the provided input readers. Following code was taken from https://go.dev/src/io/multi.go and adopted to works with csv readers.
func (*MultiReader) ReadAll ¶
func (mr *MultiReader) ReadAll() (records [][]string, err error)
ReadAll reads all the remaining records from the provided input readers.
type Reader ¶
func LazyFileReader ¶
LazyFileReader returns a LazyReader with a predefined InitFunc, which can be used in most cases. Optionally supports the CSV header skip option.