Open
Description
Assuming
import (
parser "github.com/haproxytech/config-parser/v5"
)
...
p := parser.New(content, options)
Proposal
It would be a useful feature, to be able to list all the set attributes in a given section
E.g.
attributes, err := p.AttributesGet(parser.Global, parser.GlobalSectionName) // ([]string, error)
This would allow a piece of code to iterate over the existing attributes.
Currently it's not even possible to list the registered attributes for a given section type, so if some code wanted to enumerate all the attributes e.g. in a loop, it'd need to maintain a list of attributes, while this information is readily available for the parser (both the possible (via ConfiguredParsers), and the actually set attributes (via Parsers))
(Happily) wiling to contribute code if this feature makes sense.