Documentation
¶
Index ¶
- Variables
- type Config
- type GitRepo
- type Option
- func OptBadRow(br gnfmt.BadRow) Option
- func OptBatchSize(i int) Option
- func OptCreateOriginalCombinations(b bool) Option
- func OptInferBasionyms(b bool) Option
- func OptJobsNum(i int) Option
- func OptLocalSchemaPath(path string) Option
- func OptMigrateOutputDir(dir string) Option
- func OptNomCode(code nomcode.Code) Option
- func OptSkipBasionymsIfRelationsExist(b bool) Option
- func OptWithParents(b bool) Option
- func OptWithQuotes(b bool) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SchemaVersion is the desired SFGA schema version. SchemaVersion = repoTag // RepoMinVersion is the oldest SFGA schema version that sflib can migrate. // Archives below this version must be brought up to RepoMinVersion using an // older sflib release before further migration is possible. RepoMinVersion = "v0.5.1" )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// GitRepo is used for initialization of SFGA archive.
GitRepo
// LocalSchemaPath is an optional path to a local schema.sql file.
// If set, it will be used instead of fetching from GitRepo.
LocalSchemaPath string
// NomCode represents nomenclatural code relevant for the dataset.
NomCode nomcode.Code
// BadRow sets how to process rows with wrong number of fields in CSV
// files.
BadRow gnfmt.BadRow
// WithQuotes sets CSV reader to use `"` as quote. When it is true,
// RFC-based CSV reader is used, even if delimiter is tab or pipe.
WithQuotes bool
// WithParents flag can be set to true when a dataset with a flat
// hierachy needs conversion to a parent/child hierachy.
// All IDs generated during unflattening will have 'sf-' prefix.
WithParents bool
// BatchSize tells how many elements (rows, structs) to deal with in
// a chunk of data.
BatchSize int
// JobsNum conveys the number of concurrent jobs to run, where it is
// needed.
JobsNum int
// InferBasionyms enables basionym inference during enrichment.
InferBasionyms bool
// SkipBasionymsIfRelationsExist skips basionym inference if BASIONYM
// relations already exist in the archive.
SkipBasionymsIfRelationsExist bool
// CreateOriginalCombinations creates OriginalGenus, OriginalSpecies, etc.
// relationships in addition to BASIONYM during inference.
CreateOriginalCombinations bool
// MigrateOutputDir, if set, saves a copy of the migrated SFGA file to
// this directory after auto-migration in Fetch().
MigrateOutputDir string
}
type GitRepo ¶
type GitRepo struct {
// URL to the SFGA schema repository.
URL string
// Tag is a version tag of the SFGA repository to use.
Tag string
// ShaSumSchema is sha256 hash for the content of schema.sql file.
// If the has is trucated, only trucated part is checked. If it is
// empty, no check is done.
ShaSchemaSQL string
}
type Option ¶
type Option func(*Config)
func OptBatchSize ¶
func OptCreateOriginalCombinations ¶ added in v0.6.0
func OptInferBasionyms ¶ added in v0.6.0
func OptJobsNum ¶
func OptLocalSchemaPath ¶
func OptMigrateOutputDir ¶ added in v0.6.0
func OptNomCode ¶
func OptSkipBasionymsIfRelationsExist ¶ added in v0.6.0
func OptWithParents ¶
func OptWithQuotes ¶
Click to show internal directories.
Click to hide internal directories.