importer

package
v0.0.0-...-1129a00 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadCsv

func ReadCsv[C any](ctx context.Context, r io.Reader, out chan<- Record[C])

func ReadZipCsv

func ReadZipCsv[C any](ctx context.Context, filePath string, out chan<- Record[C]) error

func Unmarshal

func Unmarshal(csvRecord []string, data any) error

Types

type DBType

type DBType string
const (
	SQLite DBType = "sqlite"
)

type Importer

type Importer struct {
	ProgressFn func(record int) error
	DbType     DBType
	DbDsn      string
}

func (Importer) ImportZipFolder

func (imp Importer) ImportZipFolder(folder string)

type ProgressUpdFun

type ProgressUpdFun func(records int) error

type Record

type Record[C any] struct {
	Data  *C
	Error error
}

type StorageService

type StorageService struct {
	// contains filtered or unexported fields
}

func NewStorageService

func NewStorageService(db *gorm.DB) *StorageService

func (StorageService) Store

func (store StorageService) Store(model any) error

Jump to

Keyboard shortcuts

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