Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultParser = NewDefaultParser()
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a list of distro-specific idStr parsers.
func New ¶
func New(parsers ...ParserFunc) *Parser
func NewDefaultParser ¶
func NewDefaultParser() *Parser
func (*Parser) Parse ¶
Parse returns the distro.ID that matches the given distro ID string. If no distro.ID matches the given distro ID string, it returns nil. If multiple distro.IDs match the given distro ID string, it panics. If no distro-specific parser matches the given distro ID string, it falls back to the default parser.
The fact that the Parser returns a distro.ID does not mean that the distro is actually supported or implemented. This functionality is provided as an easy and consistent way to parse distro IDs, while allowing distro-specific parsers.
Click to show internal directories.
Click to hide internal directories.