Documentation
¶
Overview ¶
Package vendorfragment implements the VendorFragment parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Parser)
Option is a functional option for configuring Parser behavior.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses a single user agent for vendor fragment information. Created via ParserFactory.NewParser() - do not instantiate directly.
func (*Parser) MatchedRegex ¶
MatchedRegex returns the fragment (regex) that matched during the last Parse(). Mirrors PHP: VendorFragment::getMatchedRegex(): ?string
type ParserFactory ¶
type ParserFactory struct {
// contains filtered or unexported fields
}
ParserFactory holds pre-compiled regexes and creates Parser instances. Thread-safe for concurrent use - create once, use from multiple goroutines.
func NewParserFactory ¶
func NewParserFactory(opts ...common.FactoryOption) (*ParserFactory, error)
NewParserFactory creates a factory by loading and compiling vendor fragment regexes from the embedded YAML DB.