Documentation
¶
Overview ¶
Package fftoml provides a TOML config file paser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigFileParser ¶
type ConfigFileParser struct {
// contains filtered or unexported fields
}
ConfigFileParser is a parser for the TOML file format. Flags and their values are read from the key/value pairs defined in the config file. Nested tables and keys are concatenated with a delimiter to derive the relevant flag name.
func New ¶
func New(opts ...Option) (c ConfigFileParser)
New constructs and configures a ConfigFileParser using the provided options.
type Option ¶
type Option func(*ConfigFileParser)
Option is a function which changes the behavior of the TOML config file parser.
func WithTableDelimiter ¶
WithTableDelimiter is an option which configures a delimiter used to prefix table names onto keys when constructing their associated flag name. The default delimiter is "."
For example, given the following TOML
[section.subsection] value = 10
Parse will match to a flag with the name `-section.subsection.value` by default. If the delimiter is "-", Parse will match to `-section-subsection-value` instead.
type ParseError ¶
type ParseError struct {
Inner error
}
ParseError wraps all errors originating from the TOML parser.
func (ParseError) Unwrap ¶
func (e ParseError) Unwrap() error
Unwrap implements the errors.Wrapper interface, allowing errors.Is and errors.As to work with ParseErrors.