Documentation
¶
Overview ¶
Package storage provides SQLite-based fingerprint storage for element tracking. It stores element fingerprints keyed by URL + selector identifier, enabling adaptive element relocation when website structures change.
Index ¶
- type ElementDict
- type ParentDict
- type Store
- func (s *Store) Clear() error
- func (s *Store) Close() error
- func (s *Store) Count() (int, error)
- func (s *Store) Delete(rawURL, identifier string) error
- func (s *Store) List(rawURL string) ([]string, error)
- func (s *Store) Load(rawURL, identifier string) (*ElementDict, error)
- func (s *Store) Save(rawURL, identifier string, elem *ElementDict) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ElementDict ¶
type ElementDict struct {
Tag string `json:"tag"`
Text string `json:"text"`
Attributes map[string]string `json:"attributes"`
Path []string `json:"path"`
Parent *ParentDict `json:"parent,omitempty"`
Siblings []string `json:"siblings"`
Children []string `json:"children"`
}
ElementDict represents a serialized element fingerprint.
type ParentDict ¶
type ParentDict struct {
Tag string `json:"tag"`
Attributes map[string]string `json:"attributes"`
Text string `json:"text"`
}
ParentDict represents parent element metadata for fingerprinting.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a thread-safe SQLite storage for element fingerprints.
func New ¶
New creates a new Store with the given database file path. Pass ":memory:" for an in-memory database.
Click to show internal directories.
Click to hide internal directories.