Documentation ¶
Overview ¶
Package parser provides parsing and serializing routines for the flagfile on-disk format
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse takes an io.Reader and calls the given calback for each key and unparsed value. This format is used by flagfile for loading and serializing flags.
The file format understands comments (provided the line starts with a comment character ('#' or ';')), and essentially has macros for prefixes. If a line that starts with '[' and ends with ']' is found, that is used as the key prefix for the remaining keys until the next prefix macro. Prefixes are automatically joined with a '.'. The special prefix "main" stops prefix handling.
An example file:
some.flag = 20 # some.other.flag = 50 flag3 = 10m flag4 = a string value [section1] flag1 = 30 flag2 = 40 [section2] flag1 = 50 flag2 = true
Types ¶
This section is empty.