Documentation ¶
Index ¶
- func AddColumnTitle(structModel interface{}, sheet *xlsx.Sheet)
- func AddDataToNewSheet(xlsxFile *xlsx.File, sheetName string, dataList []interface{}, ...) error
- func DeleteFileIfExist(path string) error
- func PathExists(path string) (bool, error)
- func ReadSheetRow(path, sheetName string, fun func(row *xlsx.Row) (interface{}, error)) (dataList []interface{}, err error)
- func SaveXlsx(xlsxFile *xlsx.File, path string) error
- func TransferDataToRow(data interface{}, row *xlsx.Row)
- func TransferInterfaceToString(structField reflect.StructField, data interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddColumnTitle ¶
AddColumnTitle 通过tag添加首行
func AddDataToNewSheet ¶
func AddDataToNewSheet(xlsxFile *xlsx.File, sheetName string, dataList []interface{}, fun func(data *interface{})) error
AddDataToNewSheet 添加数据到新的sheet中
func ReadSheetRow ¶
func ReadSheetRow(path, sheetName string, fun func(row *xlsx.Row) (interface{}, error)) (dataList []interface{}, err error)
ReadSheetRow 从xlsx文件的制定Sheet中按行读取 fun 是对每一行数据特殊处理的函数
func TransferDataToRow ¶
TransferDataToRow 转换结构体类型数据成一行数据
func TransferInterfaceToString ¶
func TransferInterfaceToString(structField reflect.StructField, data interface{}) string
TransferInterfaceToString 将interface转换为String类型 目前只支持 int,float,string,和上述的指针类型
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.