Documentation
¶
Index ¶
- Variables
- type ExcelExport
- type ExcelHeader
- type ExportDefine
- type ExportService
- type GetCellValue
- type Sheet
- func (s *Sheet) GetAxis() string
- func (s *Sheet) NextCell()
- func (s *Sheet) NextRow()
- func (s *Sheet) SetFloat(value float64, prec, bitSize int)
- func (s *Sheet) SetHeader(header *ExcelHeader)
- func (s *Sheet) SetInt(value int, style ...int)
- func (s *Sheet) SetString(value string)
- func (s *Sheet) SetValue(value interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var GetCellValueSimple = func(key string, data map[string]interface{}) interface{} { v, ok := data[key] if !ok { return nil } return v }
simple return the value by key, if not existed, return the empty
Functions ¶
This section is empty.
Types ¶
type ExcelExport ¶
type ExcelExport struct {
SheetName string
Index bool //similar to pandas export setting if included Index.
Columns []*ExcelHeader
Style *excelize.Style
Logger *zap.Logger
Mode GetCellValue
}
type ExcelHeader ¶
type ExportDefine ¶
type ExportDefine struct {
Query *query.RawQuery
Output *ExcelExport
}
type ExportService ¶
type ExportService struct {
Logger *zap.Logger
DB *gorm.DB
Exports []*ExportDefine
}
func (*ExportService) DoExport ¶
func (es *ExportService) DoExport(params map[string]interface{}, w io.Writer) error
func (*ExportService) Init ¶
func (es *ExportService) Init()
type GetCellValue ¶
func for how to get Value from the key defined.
Click to show internal directories.
Click to hide internal directories.