Documentation ¶
Index ¶
- Constants
- func GetDataFromXls(file multipart.File) ([][]string, error)
- func GetDataFromXlsx(file multipart.File, sheetName string) ([][]string, error)
- func New(opt ...ImportOptions) *importer
- type ImportOptions
- func WithCtx(ctx context.Context) ImportOptions
- func WithExtFile(ext string) ImportOptions
- func WithFile(file multipart.File) ImportOptions
- func WithProcessFn(fn processFn) ImportOptions
- func WithProcessName(processName string) ImportOptions
- func WithSentNotifToSlack(sent bool, channel ...string) ImportOptions
- func WithSheetName(sheetName string) ImportOptions
- func WithStructDestination(structDestination interface{}) ImportOptions
- func WithTransaction(trx database.Transactions) ImportOptions
- func WithWorker(totalWorker int) ImportOptions
- type ImportResult
Constants ¶
View Source
const ( ExcelFileType = "excel" ExcelWorkbookFileType = "excel_workbook" CSVFileType = "csv" UndefinedFileType = "" ExcelExt = ".xls" ExcelWorkbookExt = ".xlsx" CSVExt = ".csv" )
Variables ¶
This section is empty.
Functions ¶
func GetDataFromXlsx ¶ added in v2.22.0
func New ¶
func New(opt ...ImportOptions) *importer
Types ¶
type ImportOptions ¶
type ImportOptions func(reader *importer)
func WithCtx ¶
func WithCtx(ctx context.Context) ImportOptions
func WithExtFile ¶
func WithExtFile(ext string) ImportOptions
func WithFile ¶
func WithFile(file multipart.File) ImportOptions
func WithProcessFn ¶
func WithProcessFn(fn processFn) ImportOptions
func WithProcessName ¶ added in v2.17.7
func WithProcessName(processName string) ImportOptions
func WithSentNotifToSlack ¶
func WithSentNotifToSlack(sent bool, channel ...string) ImportOptions
func WithSheetName ¶
func WithSheetName(sheetName string) ImportOptions
func WithStructDestination ¶
func WithStructDestination(structDestination interface{}) ImportOptions
func WithTransaction ¶
func WithTransaction(trx database.Transactions) ImportOptions
func WithWorker ¶
func WithWorker(totalWorker int) ImportOptions
Click to show internal directories.
Click to hide internal directories.