Documentation
¶
Index ¶
- func LoadCSV(ctx context.Context, path string, skipRows int, callback LoadCSVCallback) (err error)
- func LoadConfig(ctx context.Context, configFile string, callback LoadConfigCallback) (err error)
- func LoadExcel(ctx context.Context, path string, callback LoadExcelCallback) (err error)
- func LoadExcelSheet(ctx context.Context, f *excelize.File, sheet string, skipRows int, ...) (err error)
- type LoadCSVCallback
- type LoadConfigCallback
- type LoadExcelCallback
- type LoadExcelSheetCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCSV ¶
LoadCSV 加载CSV文件 @param ctx 上下文 @param path 文件路径 @param skipRows 跳过的行数, 如果需要跳过1行, 则传入1 @param callback 回调函数
func LoadConfig ¶
func LoadConfig(ctx context.Context, configFile string, callback LoadConfigCallback) (err error)
LoadConfig 使用viper加载配置文件 @param configFile string 配置文件路径 @param callback LoadConfigCallback 回调函数
func LoadExcel ¶
func LoadExcel(ctx context.Context, path string, callback LoadExcelCallback) (err error)
LoadExcel @param ctx 上下文 @param path 文件路径 @param callback 回调函数
func LoadExcelSheet ¶
func LoadExcelSheet(ctx context.Context, f *excelize.File, sheet string, skipRows int, callback LoadExcelSheetCallback) (err error)
LoadExcelSheet @param ctx 上下文 @param f 文件对象 @param sheet 表名 @param skipRows 跳过的行数, 如果需要跳过1行, 则传入1 @param callback 回调函数
Types ¶
type LoadCSVCallback ¶
LoadCSVCallback 加载CSV回调函数 @param index 行索引, 从0开始 @param row 行数据
type LoadConfigCallback ¶
LoadConfigCallback 加载配置文件回调函数 @param v *viper.Viper
type LoadExcelCallback ¶
type LoadExcelCallback func(f *excelize.File) (err error)
LoadExcelCallback @param f 文件对象
type LoadExcelSheetCallback ¶
LoadExcelSheetCallback @param index 行索引, 从0开始 @param row 行数据
Click to show internal directories.
Click to hide internal directories.