config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 1 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 {
	// BHLdir points to a base directory of BHL texts filetree.
	BHLdir string

	// OutputFormat format of the detected names dump
	OutputFormat gnfmt.Format

	// OutputDir provides a directory path where to save dump data.
	OutputDir string

	// OutputDataSourceIDs filters data to given data-sources.
	OutputDataSourceIDs []int

	// OutputShort is true if output contains only fields required for BHL index.
	OutputShort bool

	// OutputCleanVerbatim normalizes Verbatim name removing extra-spaces and
	// non-name characters. It does not substitute bad OCR characters inside
	// of a name.
	OutputCleanVerbatim bool

	// PgHost is the IP or a name of a computer running PostgreSQL database.
	PgHost string

	// PgUser is the username with read/write access to bhlindex database.
	PgUser string

	// PgPass is the password for PgUser
	PgPass string

	// PgDatabase is the name of a database for BHLindex.
	PgDatabase string

	// Jobs is the number of parallel processes running for the name-finding.
	Jobs int

	// VerifierURL points to a remote GNverifier service.
	VerifierURL string

	// VerifAllResults, when true, return all matches instead of best results
	VerifAllResults bool

	// WithoutConfirm can be set to true to avoid confirmations before
	// destructive operations.
	WithoutConfirm bool
}

Config contains settings necessary for creating index of scientific names of Biodiversity Heritage Library.

func New

func New(opts ...Option) Config

type Option

type Option func(*Config)

func OptBHLdir

func OptBHLdir(s string) Option

func OptJobs

func OptJobs(i int) Option

func OptOutputCleanVerbatim

func OptOutputCleanVerbatim(b bool) Option

func OptOutputDataSourceIDs

func OptOutputDataSourceIDs(i []int) Option

func OptOutputDir

func OptOutputDir(s string) Option

func OptOutputFormat

func OptOutputFormat(f gnfmt.Format) Option

func OptOutputShort

func OptOutputShort(b bool) Option

func OptPgDatabase

func OptPgDatabase(s string) Option

func OptPgHost

func OptPgHost(s string) Option

func OptPgPass

func OptPgPass(s string) Option

func OptPgUser

func OptPgUser(s string) Option

func OptVerifAllResults

func OptVerifAllResults(b bool) Option

func OptVerifierURL

func OptVerifierURL(s string) Option

func OptWithoutConfirm

func OptWithoutConfirm(b bool) Option

Jump to

Keyboard shortcuts

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