Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Brand string
Regex string `yaml:"regex"`
Device string `yaml:"device"`
Model string `yaml:"model,omitempty"`
Models []Model `yaml:"models,omitempty"`
// contains filtered or unexported fields
}
Entry represents a single brand entry from notebooks.yml.
type Match ¶
type Match struct {
Type string `json:"type"`
Brand string `json:"brand"`
Model string `json:"model"`
}
Match is the parsed device result for notebook detection. Mirrors the PHP test fixtures expectation: {type, brand, model}.
type Model ¶
type Model struct {
Regex string `yaml:"regex"`
Model string `yaml:"model"`
Brand string `yaml:"brand,omitempty"`
Device string `yaml:"device,omitempty"`
}
Model represents a model-specific rule inside an entry.
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 notebook information. Created via ParserFactory.NewParser() - do not instantiate directly.
type ParserFactory ¶
type ParserFactory struct {
// contains filtered or unexported fields
}
ParserFactory holds pre-compiled matchers and creates Parser instances. Thread-safe for concurrent use - create once, use from multiple goroutines.
func NewDefaultParserFactory ¶
func NewDefaultParserFactory() (*ParserFactory, error)
NewDefaultParserFactory is an alias for NewParserFactory kept for compatibility.
func NewParserFactory ¶
func NewParserFactory(opts ...common.FactoryOption) (*ParserFactory, error)
NewParserFactory loads and compiles the notebook regex DB from the embedded YAML DB.