filter

package
v0.0.0-...-6795c90 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(n *html.Node, criterion ...Criteria) *html.Node

Apply executes each of the criteria

func Test

func Test(n *html.Node, criterion ...Criteria) bool

Types

type Criteria

type Criteria func(*html.Node) bool

func Class

func Class(c string) Criteria

Class is a convenience method that returns a FilterTest indicating whether or not an HTML node contains a class attribute with a value that matches the provided string.

func Exists

func Exists(key atom.Atom) Criteria

Exists returns a FilterTest that indicates whether or not a specific attribute is present on an HTML node.

func Id

func Id(i string) Criteria

Id is a convenience method that returns a FilterTest indicating whether or not an HTML node contains an id attribute with a value that matches the provided string.

func Matches

func Matches(key atom.Atom, val string) Criteria

Matches returns a FilterTest that indicates whether an HTML node contains a matching attribute key/value pair.

func Tag

func Tag(t atom.Atom) Criteria

Tag returns a FilterTest that indicates whether an HTML node has a tag matching the provided string.

func Type

func Type(t html.NodeType) Criteria

Type returns a FilterTest that indicates whether and HTML node is of the type passed as the sole parameter.

type Criterion

type Criterion Criteria

Jump to

Keyboard shortcuts

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