csv_parser

package module
v0.0.0-...-c06c652 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVParser

type CSVParser struct {
	FilePath     string
	Separator    rune
	HasHeader    bool
	Encoding     encoding.Encoding // 支持 UTF-8/GBK
	SkipBadLines bool
}

CSVParser 配置解析器

func (*CSVParser) ParseStruct

func (p *CSVParser) ParseStruct(slicePtr interface{}, handler StructHandler) error

ParseStruct 流式解析 CSV 并映射到 struct

type StructHandler

type StructHandler func(obj interface{}) error

StructHandler 每行处理回调

Directories

Path Synopsis
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT

Jump to

Keyboard shortcuts

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