Documentation ¶
Index ¶
- Variables
- type Excel
- func (obj *Excel) ExcelToSQL(filename string, sheetname string, tablename string, fields []string, ...) ([]string, error)
- func (obj *Excel) SliceToExcelBuff(s [][]interface{}) (buf *bytes.Buffer)
- func (obj *Excel) SliceToExcelFile(s [][]interface{}, path string, filename string) (err error)
- func (obj *Excel) SliceToGinResp(s [][]interface{}, filename string, context *gin.Context)
- func (obj *Excel) StructSliceToGinResp(slice interface{}, filename string, context *gin.Context)
- func (obj *Excel) StructToSlice(slice interface{}, addFieldName bool) [][]interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var DExcel = &Excel{}
Functions ¶
This section is empty.
Types ¶
type Excel ¶
type Excel struct{}
func (*Excel) ExcelToSQL ¶
func (obj *Excel) ExcelToSQL(filename string, sheetname string, tablename string, fields []string, is_column_mode bool) ([]string, error)
ExcelToSQL Excel转成SQL语句
func (*Excel) SliceToExcelBuff ¶
SliceToExcelBuff 将切片转换为Excel格式,并返回bytes.Buffer,可以保存为文件或写入http响应体
func (*Excel) SliceToExcelFile ¶
SliceToExcelFile 将切片写入Excel文件
func (*Excel) SliceToGinResp ¶
SliceToGinResp 将切片写入Excel文件,写入http响应体,实现Excel文件下载
func (*Excel) StructSliceToGinResp ¶
StructSliceToGinResp 将结构体切片写入Excel文件,写入http响应体,实现Excel文件下载
func (*Excel) StructToSlice ¶
StructToSlice 将任意结构体切片转换为二维切片[][]interface{},addFieldName是否添加字段名
Click to show internal directories.
Click to hide internal directories.