config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEnv added in v0.1.0

func LoadEnv(c *Config)

Types

type Config

type Config struct {
	// MinVersionSFGA sets minimal version of SFGA archive schema
	// that is needed for data extraction.
	MinVersionSFGA string

	// DataSourceID may provide information which DataSaource ID should be
	// used for importing data to GN database.
	DataSourceID int

	// DataSourceRelease provides release date of the imported data.
	DataSourceRelease string

	// DataSourceReleaseDate provides details when this version of
	// data was released.
	DataSourceReleaseDate string

	// CacheDir keeps temporary directories for extracting and accessing
	// SFGA data.
	CacheDir string

	// CacheDbDir is where SFGA database is downloaded.
	CacheDbDir string

	// DbDatabase is the name of the GN databsae, default is `gnames`.
	DbDatabase string

	// DbHost is the host of the GN database.
	DbHost string

	// DbUser is the user of the GN database with write privileges.
	DbUser string

	// DbPass is the password to the GN database for the given DbUser.
	DbPass string

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

	// BatchSize sets the size of batch for insert statements.
	BatchSize int
}

func New

func New(opts ...Option) Config

type Option

type Option func(*Config)

func OptDataSourceID

func OptDataSourceID(i int) Option

func OptDataSourceRelease

func OptDataSourceRelease(s string) Option

func OptDbDatabase

func OptDbDatabase(s string) Option

func OptDbHost

func OptDbHost(s string) Option

func OptDbPass

func OptDbPass(s string) Option

func OptDbUser

func OptDbUser(s string) Option

func OptJobsNum

func OptJobsNum(i int) Option

Jump to

Keyboard shortcuts

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