Documentation ¶
Index ¶
- type Finder
- func (f Finder) Attr() attr.List
- func (f Finder) Find(pred pred.Predicate) (r Finder)
- func (f Finder) FindAll(pred pred.Predicate) FinderStream
- func (f Finder) FindPrevSibling(pred pred.Predicate) (r Finder)
- func (f Finder) FindPrevSiblings(pred pred.Predicate) FinderStream
- func (f Finder) FindSibling(pred pred.Predicate) (r Finder)
- func (f Finder) FindSiblings(pred pred.Predicate) FinderStream
- func (f Finder) FirstChild() Finder
- func (f Finder) InnerText() string
- func (f Finder) IsEmpty() bool
- func (f Finder) LastChild() Finder
- func (f Finder) NextSibling() Finder
- func (f Finder) Parent() Finder
- func (f Finder) PrevSibling() Finder
- func (f Finder) String() string
- func (f Finder) Write(w io.Writer)
- type FinderStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finder ¶
func FinderFromNode ¶
func FinderFromString ¶
func (Finder) Find ¶
Find performs depth-first traversal looking for a node satisfying `pred`. Includes current node in the search. Stops at the first found node and returns it, wrapped in a new Finder.
func (Finder) FindAll ¶ added in v0.8.0
func (f Finder) FindAll(pred pred.Predicate) FinderStream
FindAll performs depth-first traversal like Find, but returns a stream of all found nodes, each wrapped in a Finder. FinderStream is really a readonly channel. Current node is included in the search.
func (Finder) FindPrevSibling ¶ added in v0.4.0
FindPrevSibling performs flat find among node's previous (left) siblings. No recursion. Omits current node, starts from a first such sibling.
func (Finder) FindPrevSiblings ¶ added in v0.8.0
func (f Finder) FindPrevSiblings(pred pred.Predicate) FinderStream
func (Finder) FindSibling ¶
FindSibling performs flat find among node's next (right) siblings. No recursion. Omits current node, starts from a first such sibling.
func (Finder) FindSiblings ¶ added in v0.8.0
func (f Finder) FindSiblings(pred pred.Predicate) FinderStream
func (Finder) FirstChild ¶
func (Finder) NextSibling ¶
func (Finder) PrevSibling ¶ added in v0.4.0
type FinderStream ¶ added in v0.8.0
type FinderStream <-chan Finder
func (FinderStream) Collect ¶ added in v0.8.0
func (ff FinderStream) Collect() (res []Finder)
func (FinderStream) Filter ¶ added in v0.8.0
func (ff FinderStream) Filter(p pred.Predicate) FinderStream
func (FinderStream) First ¶ added in v0.8.0
func (ff FinderStream) First() Finder
func (FinderStream) Last ¶ added in v0.8.0
func (ff FinderStream) Last() (f Finder)