config

package
v0.2.6 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: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RootPath is the root path for all temporary files.
	RootPath string

	// DownloadPath is used to store downloaded files.
	DownloadPath string

	// ExtractPath is used to store extracted files of DwCA archive.
	ExtractPath string

	// OutputPath is used to store uncompressed files of a normalized
	// DwCA archive. This files are created from the original DwCA archive
	// data.
	OutputPath string

	// OutputArchiveCompression is the compression format to use when
	// creating the output archive. It can be "zip" or "tar.gz".
	OutputArchiveCompression string

	// OutputCSVType is the type of CSV files. Can be "csv" or "tsv"
	OutputCSVType string

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

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 OptArchiveCompression

func OptArchiveCompression(s string) Option

OptOutputArchiveCompression sets the compression format to use when creating the output archive. It can be "zip" or "tar.gz".

func OptJobsNum

func OptJobsNum(n int) Option

OptJobsNum sets the number of concurrent jobs to run.

func OptOutputCSVType

func OptOutputCSVType(s string) Option

OptOutputCSVType sets the type of CSV files. Can be "csv" or "tsv"

func OptRootPath

func OptRootPath(s string) Option

OptRootPath sets the root path for all temporary files.

Jump to

Keyboard shortcuts

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