Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CsvParser ¶
type CsvParser struct {
// contains filtered or unexported fields
}
nolint
func NewCsvParser ¶
func NewCsvParser(context context.Context, opts ...ParserWithOption) *CsvParser
func (*CsvParser) AsyncReadAllRows ¶
func (c *CsvParser) AsyncReadAllRows(ctx context.Context, filepath string, ops ...ReaderWithOption) (<-chan []string, error)
异步读取csv文件
func (*CsvParser) ReadFromFile ¶
func (c *CsvParser) ReadFromFile(filepath string, ops ...ReaderWithOption) (dataList [][]string, err error)
读取整个csv文件
type ParserWithOption ¶
type ParserWithOption func(*CsvParser)
func WithNewLogger ¶
func WithNewLogger(logg logger.Logger) ParserWithOption
type ReaderWithOption ¶
func ReaderWithComma ¶
func ReaderWithComma(flag rune) ReaderWithOption
ReaderWithComma 设置分隔符 默认 ','
func ReaderWithComment ¶
func ReaderWithComment(flag rune) ReaderWithOption
ReaderWithComment 设置评论标识 默认是 空的
Click to show internal directories.
Click to hide internal directories.