config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 4 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 {
	GNport      int
	WorkDir     string
	JobsNum     int
	MaxEditDist int
	PgHost      string
	PgPort      int
	PgUser      string
	PgPass      string
	PgDB        string
	MatcherURL  string
}

Config collects and stores external configuration data.

func NewConfig

func NewConfig(opts ...Option) Config

NewConfig is a Config constructor that takes external options to update default values to external ones.

func (Config) FiltersDir

func (cnf Config) FiltersDir() string

FiltersDir returns path where to dump/restore serialized bloom filters.

func (Config) StemsDir

func (cnf Config) StemsDir() string

StemsDir returns path where stems key-value store is located

func (Config) TrieDir

func (cnf Config) TrieDir() string

TrieDir returns path where to dump/restore serialized trie.

type Option

type Option func(cnf *Config)

Option is a type of all options for Config.

func OptGNPort

func OptGNPort(i int) Option

OptGNPort sets port for gnames HTTP service.

func OptJobsNum

func OptJobsNum(i int) Option

OptJobsNum sets number of concurrent jobs to run for parallel tasks.

func OptMatcherURL

func OptMatcherURL(s string) Option

OptMatcherURL sets the name of gnames database

func OptMaxEditDist

func OptMaxEditDist(i int) Option

OptMaxEditDist sets maximal possible edit distance for fuzzy matching of stemmed canonical forms.

func OptPgDB

func OptPgDB(s string) Option

OptPgDB sets the name of gnames database

func OptPgHost

func OptPgHost(s string) Option

OptPgHost sets the host of gnames database

func OptPgPass

func OptPgPass(s string) Option

OptPgPass sets the password to access gnnames database

func OptPgPort

func OptPgPort(i int) Option

OptPgPort sets the port for gnames database

func OptPgUser

func OptPgUser(s string) Option

OptPgUser sets the user of gnnames database

func OptWorkDir

func OptWorkDir(s string) Option

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

Jump to

Keyboard shortcuts

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