config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 3 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 {
	// RepoURL is the URL to the SFGA schema repository.
	RepoURL string

	// RepoPath is a temporary location to schema files downloaded from GitHub.
	RepoPath string

	// RepoTag is a tag of the SFGA repository to use.
	RepoTag string

	// RootPath is the root path for all temporary files.
	RootPath string

	// DBPath is the path SFGA database.
	DBPath string

	// DumpPath is the path to store the resulting sqlite file with data.
	DumpPath 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

	// InMemory is a flag to use in-memory sqlite database.
	InMemory 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 OptDumpPath

func OptDumpPath(s string) Option

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

func OptInMemory

func OptInMemory(b bool) Option

OptInMemory sets the flag to use in-memory sqlite database.

func OptJobsNum

func OptJobsNum(n int) Option

OptJobsNum sets the number of concurrent jobs to run.

func OptRootPath

func OptRootPath(s string) Option

OptRootPath sets the root path for all temporary files.

func OptSchemaPath

func OptSchemaPath(s string) Option

OptSchemaPath sets the path to store the sqlite schema file.

Jump to

Keyboard shortcuts

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