builder_pg

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const BatchSize = 100_000

Variables

This section is empty.

Functions

This section is empty.

Types

type BuilderPG

type BuilderPG struct {
	config.Config
	DB     *sql.DB
	GormDB *gorm.DB
}

func NewBuilderPG

func NewBuilderPG(cfg config.Config) BuilderPG

func (BuilderPG) ImportData

func (b BuilderPG) ImportData() error

func (BuilderPG) ResetData

func (b BuilderPG) ResetData()

type Title

type Title struct {
	ID        int
	Name      string
	YearStart sql.NullInt32
	YearEnd   sql.NullInt32
	Language  string
	DOI       string
}

type WriteCounter

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

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func NewWriteCounter

func NewWriteCounter(total int) *WriteCounter

NewWriteCounter is a constructor for WriteCounter type.

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Write writes more bytes to WriteCounter and sets the progress for progress bar.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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