config

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// TempRepoDir is a temporary location to schema files downloaded from GitHub.
	TempRepoDir string

	// CacheDir is the root path for all cached files.
	CacheDir string

	// CacheSfgaDir is the path SFGA database.
	CacheSfgaDir string

	// JobsNum is the number of concurrent jobs to run.
	JobsNum int

	// BatchSize is the number of records to insert in one transaction.
	BatchSize int

	// BadRow dets decision what to do if a row has more/less fields
	// than it should.
	BadRow gnfmt.BadRow

	// WithBinOutput is a flag to output binary SQLite database instead of
	// SQL dump.
	WithBinOutput bool

	// WithZipOutput is a flag to return zipped SFGAarchive outpu.
	WithZipOutput bool
}

Config is a configuration object for the Darwin Core Archive (DwCA) data processing.

func New

func New(opts ...Option) Config

New creates a new Config object with default values, and allows to override them with options.

type Option

type Option func(*Config)

Option is a function type that allows to standardize how options to the configuration are organized.

func OptCacheDir added in v0.0.4

func OptCacheDir(s string) Option

OptCacheDir sets the root path for all temporary files.

func OptCacheSfgaDir added in v0.0.4

func OptCacheSfgaDir(s string) Option

OptCacheSfgaDir sets the path to store resulting sqlite file with data imported from DwCA file.

func OptJobsNum

func OptJobsNum(n int) Option

OptJobsNum sets the number of concurrent jobs to run.

func OptWithBinOutput added in v0.0.4

func OptWithBinOutput(b bool) Option

OptWithBinOutput sets output as binary SQLite file.

func OptWithZipOutput added in v0.0.4

func OptWithZipOutput(b bool) Option

OptWithZipOutput sets output as binary SQLite file.

func OptWrongFieldsNum added in v0.5.0

func OptWrongFieldsNum(br gnfmt.BadRow) Option

Jump to

Keyboard shortcuts

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