matcher

package
v0.0.0-...-61000f8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter corresponding to the type of search that you want to do is important to know that all this filters can be reuse in any time

func (*Filter) Match

func (f *Filter) Match(n *html.Node) bool

Match is the implemetation of the Matcher interface

func (*Filter) String

func (f *Filter) String() string

type MatchFunc

type MatchFunc func(*html.Node) bool

MatchFunc is the signature of a matcher entering a node and returning true if this node match the proper pattern

type Matcher

type Matcher interface {
	Match(*html.Node) bool
	fmt.Stringer
}

Matcher is the proper matcher interface if you want to create a custom matcher you should implent this interface

func NewByAttribute

func NewByAttribute(key, value string) Matcher

NewByAttribute search for any attribute that implement the given Key with the given Value

func WithClass

func WithClass(value string) Matcher

WithClass match any tag with a class with a stringis a constructor that return a filter that going to match if the node pass to the match method implemet the specify class

func WithParent

func WithParent(match ...Matcher) Matcher

WithParent is a function that can be pass to a ogle and integrate some previus filter over the base of tags and attributes

func WithTag

func WithTag(a atom.Atom) Matcher

WithTag is a constructor for creating a filter that going to filter anything containing the corresponding atom tag

Jump to

Keyboard shortcuts

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