Documentation ¶
Index ¶
- type Config
- type Option
- func OptGNPort(i int) Option
- func OptJobsNum(i int) Option
- func OptMatcherURL(s string) Option
- func OptMaxEditDist(i int) Option
- func OptNsqdContainsFilter(s string) Option
- func OptNsqdRegexFilter(s string) Option
- func OptNsqdTCPAddress(s string) Option
- func OptPgDB(s string) Option
- func OptPgHost(s string) Option
- func OptPgPass(s string) Option
- func OptPgPort(i int) Option
- func OptPgUser(s string) Option
- func OptWithWebLogs(b bool) Option
- func OptWorkDir(s string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Port is the REST service port Port int // CacheDir is a directory to keep cached data. CacheDir string // JobsNum is the number of processes to run concurrently. JobsNum int // MaxEditDist is the the muximum number of Levenschein edits before // aborging a fuzzy matching. MaxEditDist int // MatcherURL is the URL where GNmatcher REST service resides. // It is used to get source-agnostic name-matching. MatcherURL string // PgDB is the name of GNames database. PgDB string // PgHost is the domain name or IP address of PostgreSQL service. PgHost string // PgPass is the password for the PostgreSQL user. PgPass string // PgPort is the port used by PostgreSQL service. PgPort int // PgUser is the PostgreSQL user with access to GNames database. PgUser string // NsqdTCPAddress provides an address to the NSQ messenger TCP service. If // this value is set and valid, the web logs will be published to the NSQ. // The option is ignored if `Port` is not set. // // If WithWebLogs option is set to `false`, but `NsqdTCPAddress` is set to a // valid URL, the logs will be sent to the NSQ messanging service, but they // wil not appear as STRERR output. // Example: `127.0.0.1:4150` NsqdTCPAddress string // NsqdContainsFilter logs should match the filter to be sent to NSQ // service. // Examples: // "api" - logs should contain "api" // "!api" - logs should not contain "api" NsqdContainsFilter string // NsqdRegexFilter logs should match the regular expression to be sent to // NSQ service. // Example: `api\/v(0|1)` NsqdRegexFilter *regexp.Regexp // WithWebLogs flag enables logs when running web-service. This flag is // ignored if `Port` value is not set. WithWebLogs bool }
Config collects and stores external configuration data.
func (Config) FiltersDir ¶
FiltersDir returns path where to dump/restore serialized bloom filters.
type Option ¶
type Option func(cnf *Config)
Option is a type of all options for Config.
func OptJobsNum ¶
OptJobsNum sets number of concurrent jobs to run for parallel tasks.
func OptMatcherURL ¶
OptMatcherURL sets the name of gnames database
func OptMaxEditDist ¶
OptMaxEditDist sets maximal possible edit distance for fuzzy matching of stemmed canonical forms.
func OptNsqdContainsFilter ¶ added in v0.6.4
OptNsqdContainsFilter provides a filter for logs sent to NSQ service.
func OptNsqdRegexFilter ¶ added in v0.6.4
OptNsqdRegexFilter provides a regular expression filter for logs sent to NSQ service.
func OptNsqdTCPAddress ¶ added in v0.6.4
OptNsqdTCPAddress provides a URL to NSQ messanging service.
func OptWithWebLogs ¶ added in v0.6.0
OptWithWebLogs sets the WithWebLogs field.
func OptWorkDir ¶
OptWorkDir sets a directory for key-value stores and temporary files.