config

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 5 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 {
	// CacheDir is a path to working directory. Files in this directory
	// are cleaned up before each use of the app.
	CacheDir string

	// DownloadDir is the path to the directory where downloaded files are
	// stored
	DownloadDir string

	// ImportDir is a path to a directory where source files are moved
	// or extracted to.
	ImportDir string

	// OutputDir is a cache directory where new archive files are created. When
	// all is ready the files will be exported to an output file.
	OutputDir string

	// DiffSrcDir is a path of a directory where the source SFGA file resides.
	// This file is to be compared with the target SFGA file.
	DiffSrcDir string

	// DiffRefDir is a path to a directory where the target SFGA file resides.
	// This source SFGA file will be compared with the target file.
	DiffRefDir string

	// DiffWorkDir contains data necessary for comparing data of source and
	// target SFGA files. It can be a suffix trie data, bloom filter backup etc.
	DiffWorkDir string

	// DiffSourceTaxon defines a taxon in the source file that limits comparison
	// to the children of the taxon.
	DiffSourceTaxon string

	// DiffTargetTaxon defines a taxon in the target file that limits comparison
	// to the children of the taxon.
	DiffTargetTaxon string

	// ColdpNameUsage tells ToColdp covertor to combine name, taxon, synonym
	// data into name usage.
	ColdpNameUsage bool

	// NomCode tells which Nomenclatural Code to insert to all records of
	// coldp.Name records, as well as setting up GNparser code mode.
	// If imported data alread has the Code information, the data has a
	// precedence.
	NomCode nomcode.Code

	// BadRow sets how to process rows with wrong number of fields in CSV
	// files. By default it is set to process such rows. Other options are
	// to return an error, or skip them.
	BadRow gnfmt.BadRow

	// BatchSize determines the size of slices to import into SFGA.
	BatchSize int

	// Number of concurrent jobs.
	JobsNum int

	// WithParents can be used to attempt creation of parent/child tree out of
	// flat classification.
	WithParents bool

	// WithQuotes can be used to parse faster tab- or pipe-delimited
	// files where fields never escaped by quotes.
	WithQuotes bool

	// WithZipOutput indicates that zipped archives have to be created.
	WithZipOutput bool

	// WithParser indicates that GNparser detailed data will be used to
	// populate name fields (eg. data like  Uninomial, Genus, SpecificEpithet,
	// CombinationAuthorship etc).
	WithParser bool
}

Config contains configuration data of the app.

func New

func New(opts ...Option) Config

func (Config) OptsSflib added in v0.2.5

func (c Config) OptsSflib() []sflibCfg.Option

type Option

type Option func(*Config)

Option type is used for all options sent to the config file.

func OptBadRow

func OptBadRow(br gnfmt.BadRow) Option

func OptBatchSize

func OptBatchSize(i int) Option

func OptCacheDir

func OptCacheDir(s string) Option

func OptColdpNameUsage

func OptColdpNameUsage(b bool) Option

func OptDiffSourceTaxon

func OptDiffSourceTaxon(s string) Option

func OptDiffTargetTaxon

func OptDiffTargetTaxon(s string) Option

func OptJobsNum

func OptJobsNum(i int) Option

func OptNoParser added in v0.2.3

func OptNoParser(b bool) Option

func OptNomCode

func OptNomCode(code nomcode.Code) Option

func OptWithParents added in v0.2.5

func OptWithParents(b bool) Option

func OptWithQuotes

func OptWithQuotes(b bool) Option

func OptWithZipOutput

func OptWithZipOutput(b bool) Option

Jump to

Keyboard shortcuts

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