importer

package
v2.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: CC0-1.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExcelFileType     = "excel"
	CSVFileType       = "csv"
	UndefinedFileType = ""
)

Variables

This section is empty.

Functions

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

type ImportResult added in v2.18.0

type ImportResult struct {
	FailedList    map[string][]interface{} `json:"failed_list"`
	TotalData     int                      `json:"total_data"`
	TotalFailed   int                      `json:"total_failed"`
	ExecutionTime float64                  `json:"execution_time"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL