match

package
v2.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(ø *Element, m Matcher) (r []*Element)

filter by anything that fullfills the matcher interface, e.g. Class, Id, Attr, Attrs, Css, Tag, Style, Styles recursive finds all tags from the children

func And

func And(m ...Matcher) and

func Any

func Any(ø *Element, m Matcher) (r *Element)

filter by anything that fullfills the matcher interface, e.g. Class, Id, Attr, Attrs, Css, Tag, Style, Styles returns the first tag in the children and the subchildren that matches

func Not

func Not(m Matcher) *not

func Or

func Or(m ...Matcher) or

Types

type FieldMatcher

type FieldMatcher int

func (FieldMatcher) Matches

func (ø FieldMatcher) Matches(t *Element) (m bool)

type Matcher

type Matcher interface {
	Matches(*Element) bool
}

something that matches an Element

func Attribute

func Attribute(a types.Attribute) Matcher

func Class

func Class(c types.Class) Matcher

func HTML

func HTML(h types.HTMLString) Matcher

func Id

func Id(i types.Id) Matcher

func New

func New(thing interface{}) Matcher

func Style

func Style(s types.Style) Matcher

func Tag

func Tag(t types.Tag) Matcher

type PositionMatcher

type PositionMatcher struct {
	Element *Element
	Pos     int
	Found   bool
}

func (*PositionMatcher) Matches

func (ø *PositionMatcher) Matches(e *Element) (f bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL