Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Format sets the output format for CLI and Web interfaces. // There are 3 formats available: 'CSV', 'CompactJSON' and // 'PrettyJSON'. Format format.Format // JobsNum sets a level of parallelism used during parsing of // a stream of name-strings. JobsNum int // BatchSize sets the maximum number of elements in names-strings slice. BatchSize int // WithStream changes from parsing a batch by batch, to parsing one name // at a time. When WithStream is true, BatchSize setting is ignored. WithStream bool // IgnoreHTMLTags can be set to true when it is desirable to clean up names from // a few HTML tags often present in names-strings that were planned to be // presented via an HTML page. IgnoreHTMLTags bool // WithDetails can be set to true when a simplified output is not sufficient // for obtaining a required information. WithDetails bool // Port to run wer-service. Port int // IsTest can be set to true when parsing functionality is used for tests. // In such cases the `ParserVersion` field is presented as `test_version` // instead of displaying the actual version of `gnparser`. IsTest bool }
Config keeps settings that might affect how parsing is done, of change the parsing output.
type Option ¶
type Option func(*Config)
Option is a type that has to be returned by all Option functions. Such functions are able to modify the settings of a Config object.
func OptBatchSize ¶
OptBatchSize sets the max number of names in a batch.
func OptFormat ¶
OptFormat takes a string (one of 'csv', 'compact', 'pretty') to set the formatting option for the CLI or Web presentation. If some other string is entered, the default, 'CSV' format is set, accompanied by a warning.
func OptIgnoreHTMLTags ¶
OptKeepHTMLTags sets the RemoveHTML field.
Click to show internal directories.
Click to hide internal directories.