importer

package
v14.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Importer

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

Importer creates database records for repositories which are missing from the database but are present on the virtual storage's primary's disk.

func New

func New(nm nodes.Manager, virtualStorages []string, db glsql.Querier) *Importer

New creates a new Importer.

func (*Importer) Run

func (imp *Importer) Run(ctx context.Context) <-chan Result

Run walks the repositories on primary nodes of each virtual storage and creates database records for every repository on the primary's disk that is missing from the database. Run only performs the import for virtual storages that have not had the import successfully completed before. The returned channel must be consumed in order to release the goroutines created by Run.

type Result

type Result struct {
	// Error is set if the import was aborted by an error.
	Error error
	// VirtualStorage indicates which virtual storage this result relates to.
	VirtualStorage string
	// RelativePaths includes the relative paths of repositories successfully imported
	// in a batch.
	RelativePaths []string
}

Result is a partial result of the import. VirtualStorage is set in each Result, along with either Error or RelativePaths.

Jump to

Keyboard shortcuts

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