seeder

package
v0.0.0-...-92f7fd9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	UnLoCode       string
	Name           string
	CountryCode    string
	IsPort         bool
	IsAirport      bool
	IsTrainStation bool
	Latitude       float64
	Longitude      float64
	HasCoordinates bool
}

func ProcessCSV

func ProcessCSV(filePath string, metrics *SeederMetrics) ([]Location, error)

type SeederMetrics

type SeederMetrics struct {
	TotalRecords       int64
	ValidCoordinates   int64
	InvalidCoordinates int64
	SkippedRecords     int
	ProcessingDuration time.Duration
	DatabaseDuration   time.Duration
	BatchSize          int
}

func SeedLocations

func SeedLocations(db *sql.DB, batchSize int) (*SeederMetrics, error)

Jump to

Keyboard shortcuts

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