config

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 2 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 {
	// InputDir is a directory for temporary files and key-value stores.
	InputDir string

	// DumpDir is a directory to keep CSV dump files.
	DumpDir string

	// SciKVDir is a directory to keep key-value store for scientific names.
	SciKVDir string

	// VernKVDir is a directory to keep key-value store for vernacular names.
	VernKVDir string

	// JobsNum is a number of concurrent goroutines.
	JobsNum int

	// MyHost is a host name for MySQL.
	MyHost string

	// MyUser is a user name for MySQL.
	MyUser string

	// MyPass is a password for MySQL.
	MyPass string

	// MyDB is a database name for MySQL.
	MyDB string

	// PgHost is a host name for PostgreSQL.
	PgHost string

	// PgUser is a user name for PostgreSQL.
	PgUser string

	// PgPass is a password for PostgreSQL.
	PgPass string

	// PgDB is a database name for PostgreSQL.
	PgDB string

	// Curated is a list of data-sources IDs we consider to be curated by humans.
	Curated []int

	// AutoCurated is a list of data-sources IDs we consider to be curated by
	// machines.
	AutoCurated []int

	// BatchSize is a number of records to be saved in one transaction.
	BatchSize int
}

Config is a struct that holds configuration parameters for the package.

func New

func New(opts ...Option) Config

type Option

type Option func(*Config)

Option type allows to change settings for Config.

func OptInputDir

func OptInputDir(d string) Option

OptInputDir sets a directory for temporary files and key-value stores.

func OptJobsNum

func OptJobsNum(j int) Option

OptJobsNum sets parallelism number for concurrent goroutines.

func OptMyDB

func OptMyDB(d string) Option

OptMyDB sets database name for MySQL

func OptMyHost

func OptMyHost(h string) Option

OptMyHost sets host for MySQL

func OptMyPass

func OptMyPass(p string) Option

OptMyPass sets password for MySQL

func OptMyUser

func OptMyUser(u string) Option

OptMyUser sets user for MySQL

func OptPgDB

func OptPgDB(d string) Option

OptPgDB sets database name for PostgreSQL

func OptPgHost

func OptPgHost(h string) Option

OptPgHost sets host name for PostgreSQL

func OptPgPass

func OptPgPass(p string) Option

OptPgPass sets password for PostgreSQL

func OptPgUser

func OptPgUser(u string) Option

OptPgUser sets user for PostgreSQL

Jump to

Keyboard shortcuts

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