launder

package
v0.0.0-...-6fe145f Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToEnd = maxInt
)

Variables

This section is empty.

Functions

func NodeName

func NodeName(s *Selection) string

func OuterHtml

func OuterHtml(s *Selection) (string, error)

func Render

func Render(w io.Writer, s *Selection) error

Types

type Document

type Document struct {
	*Selection
	Url *url.URL
	// contains filtered or unexported fields
}

func CloneDocument

func CloneDocument(doc *Document) *Document

func NewDocument

func NewDocument(url string) (*Document, error)

func NewDocumentFromNode

func NewDocumentFromNode(root *html.Node) *Document

func NewDocumentFromReader

func NewDocumentFromReader(r io.Reader) (*Document, error)

func NewDocumentFromResponse

func NewDocumentFromResponse(res *http.Response) (*Document, error)

type Matcher

type Matcher interface {
	Match(*html.Node) bool
	MatchAll(*html.Node) []*html.Node
	Filter([]*html.Node) []*html.Node
}

func Single

func Single(selector string) Matcher

func SingleMatcher

func SingleMatcher(m Matcher) Matcher

type Selection

type Selection struct {
	Nodes []*html.Node
	// contains filtered or unexported fields
}

func (*Selection) Add

func (s *Selection) Add(selector string) *Selection

func (*Selection) AddBack

func (s *Selection) AddBack() *Selection

func (*Selection) AddBackFiltered

func (s *Selection) AddBackFiltered(selector string) *Selection

func (*Selection) AddBackMatcher

func (s *Selection) AddBackMatcher(m Matcher) *Selection

func (*Selection) AddClass

func (s *Selection) AddClass(class ...string) *Selection

func (*Selection) AddMatcher

func (s *Selection) AddMatcher(m Matcher) *Selection

func (*Selection) AddNodes

func (s *Selection) AddNodes(nodes ...*html.Node) *Selection

func (*Selection) AddSelection

func (s *Selection) AddSelection(sel *Selection) *Selection

func (*Selection) After

func (s *Selection) After(selector string) *Selection

func (*Selection) AfterHtml

func (s *Selection) AfterHtml(htmlStr string) *Selection

func (*Selection) AfterMatcher

func (s *Selection) AfterMatcher(m Matcher) *Selection

func (*Selection) AfterNodes

func (s *Selection) AfterNodes(ns ...*html.Node) *Selection

func (*Selection) AfterSelection

func (s *Selection) AfterSelection(sel *Selection) *Selection

func (*Selection) AndSelf

func (s *Selection) AndSelf() *Selection

func (*Selection) Append

func (s *Selection) Append(selector string) *Selection

func (*Selection) AppendHtml

func (s *Selection) AppendHtml(htmlStr string) *Selection

func (*Selection) AppendMatcher

func (s *Selection) AppendMatcher(m Matcher) *Selection

func (*Selection) AppendNodes

func (s *Selection) AppendNodes(ns ...*html.Node) *Selection

func (*Selection) AppendSelection

func (s *Selection) AppendSelection(sel *Selection) *Selection

func (*Selection) Attr

func (s *Selection) Attr(attrName string) (val string, exists bool)

func (*Selection) AttrOr

func (s *Selection) AttrOr(attrName, defaultValue string) string

func (*Selection) Before

func (s *Selection) Before(selector string) *Selection

func (*Selection) BeforeHtml

func (s *Selection) BeforeHtml(htmlStr string) *Selection

func (*Selection) BeforeMatcher

func (s *Selection) BeforeMatcher(m Matcher) *Selection

func (*Selection) BeforeNodes

func (s *Selection) BeforeNodes(ns ...*html.Node) *Selection

func (*Selection) BeforeSelection

func (s *Selection) BeforeSelection(sel *Selection) *Selection

func (*Selection) Children

func (s *Selection) Children() *Selection

func (*Selection) ChildrenFiltered

func (s *Selection) ChildrenFiltered(selector string) *Selection

func (*Selection) ChildrenMatcher

func (s *Selection) ChildrenMatcher(m Matcher) *Selection

func (*Selection) Clone

func (s *Selection) Clone() *Selection

func (*Selection) Closest

func (s *Selection) Closest(selector string) *Selection

func (*Selection) ClosestMatcher

func (s *Selection) ClosestMatcher(m Matcher) *Selection

func (*Selection) ClosestNodes

func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection

func (*Selection) ClosestSelection

func (s *Selection) ClosestSelection(sel *Selection) *Selection

func (*Selection) Contains

func (s *Selection) Contains(n *html.Node) bool

func (*Selection) Contents

func (s *Selection) Contents() *Selection

func (*Selection) ContentsFiltered

func (s *Selection) ContentsFiltered(selector string) *Selection

func (*Selection) ContentsMatcher

func (s *Selection) ContentsMatcher(m Matcher) *Selection

func (*Selection) Each

func (s *Selection) Each(f func(int, *Selection)) *Selection

func (*Selection) EachWithBreak

func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection

func (*Selection) Empty

func (s *Selection) Empty() *Selection

func (*Selection) End

func (s *Selection) End() *Selection

func (*Selection) Eq

func (s *Selection) Eq(index int) *Selection

func (*Selection) Filter

func (s *Selection) Filter(selector string) *Selection

func (*Selection) FilterFunction

func (s *Selection) FilterFunction(f func(int, *Selection) bool) *Selection

func (*Selection) FilterMatcher

func (s *Selection) FilterMatcher(m Matcher) *Selection

func (*Selection) FilterNodes

func (s *Selection) FilterNodes(nodes ...*html.Node) *Selection

func (*Selection) FilterSelection

func (s *Selection) FilterSelection(sel *Selection) *Selection

func (*Selection) Find

func (s *Selection) Find(selector string) *Selection

func (*Selection) FindMatcher

func (s *Selection) FindMatcher(m Matcher) *Selection

func (*Selection) FindNodes

func (s *Selection) FindNodes(nodes ...*html.Node) *Selection

func (*Selection) FindSelection

func (s *Selection) FindSelection(sel *Selection) *Selection

func (*Selection) First

func (s *Selection) First() *Selection

func (*Selection) Get

func (s *Selection) Get(index int) *html.Node

func (*Selection) Has

func (s *Selection) Has(selector string) *Selection

func (*Selection) HasClass

func (s *Selection) HasClass(class string) bool

func (*Selection) HasMatcher

func (s *Selection) HasMatcher(m Matcher) *Selection

func (*Selection) HasNodes

func (s *Selection) HasNodes(nodes ...*html.Node) *Selection

func (*Selection) HasSelection

func (s *Selection) HasSelection(sel *Selection) *Selection

func (*Selection) Html

func (s *Selection) Html() (ret string, e error)

func (*Selection) Index

func (s *Selection) Index() int

func (*Selection) IndexMatcher

func (s *Selection) IndexMatcher(m Matcher) int

func (*Selection) IndexOfNode

func (s *Selection) IndexOfNode(node *html.Node) int

func (*Selection) IndexOfSelection

func (s *Selection) IndexOfSelection(sel *Selection) int

func (*Selection) IndexSelector

func (s *Selection) IndexSelector(selector string) int

func (*Selection) Intersection

func (s *Selection) Intersection(sel *Selection) *Selection

func (*Selection) Is

func (s *Selection) Is(selector string) bool

func (*Selection) IsFunction

func (s *Selection) IsFunction(f func(int, *Selection) bool) bool

func (*Selection) IsMatcher

func (s *Selection) IsMatcher(m Matcher) bool

func (*Selection) IsNodes

func (s *Selection) IsNodes(nodes ...*html.Node) bool

func (*Selection) IsSelection

func (s *Selection) IsSelection(sel *Selection) bool

func (*Selection) Last

func (s *Selection) Last() *Selection

func (*Selection) Length

func (s *Selection) Length() int

func (*Selection) Map

func (s *Selection) Map(f func(int, *Selection) string) (result []string)

func (*Selection) Next

func (s *Selection) Next() *Selection

func (*Selection) NextAll

func (s *Selection) NextAll() *Selection

func (*Selection) NextAllFiltered

func (s *Selection) NextAllFiltered(selector string) *Selection

func (*Selection) NextAllMatcher

func (s *Selection) NextAllMatcher(m Matcher) *Selection

func (*Selection) NextFiltered

func (s *Selection) NextFiltered(selector string) *Selection

func (*Selection) NextFilteredUntil

func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection

func (*Selection) NextFilteredUntilMatcher

func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection

func (*Selection) NextFilteredUntilNodes

func (s *Selection) NextFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection

func (*Selection) NextFilteredUntilSelection

func (s *Selection) NextFilteredUntilSelection(filterSelector string, sel *Selection) *Selection

func (*Selection) NextMatcher

func (s *Selection) NextMatcher(m Matcher) *Selection

func (*Selection) NextMatcherUntilNodes

func (s *Selection) NextMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection

func (*Selection) NextMatcherUntilSelection

func (s *Selection) NextMatcherUntilSelection(filter Matcher, sel *Selection) *Selection

func (*Selection) NextUntil

func (s *Selection) NextUntil(selector string) *Selection

func (*Selection) NextUntilMatcher

func (s *Selection) NextUntilMatcher(m Matcher) *Selection

func (*Selection) NextUntilNodes

func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection

func (*Selection) NextUntilSelection

func (s *Selection) NextUntilSelection(sel *Selection) *Selection

func (*Selection) Not

func (s *Selection) Not(selector string) *Selection

func (*Selection) NotFunction

func (s *Selection) NotFunction(f func(int, *Selection) bool) *Selection

func (*Selection) NotMatcher

func (s *Selection) NotMatcher(m Matcher) *Selection

func (*Selection) NotNodes

func (s *Selection) NotNodes(nodes ...*html.Node) *Selection

func (*Selection) NotSelection

func (s *Selection) NotSelection(sel *Selection) *Selection

func (*Selection) Parent

func (s *Selection) Parent() *Selection

func (*Selection) ParentFiltered

func (s *Selection) ParentFiltered(selector string) *Selection

func (*Selection) ParentMatcher

func (s *Selection) ParentMatcher(m Matcher) *Selection

func (*Selection) Parents

func (s *Selection) Parents() *Selection

func (*Selection) ParentsFiltered

func (s *Selection) ParentsFiltered(selector string) *Selection

func (*Selection) ParentsFilteredUntil

func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection

func (*Selection) ParentsFilteredUntilMatcher

func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection

func (*Selection) ParentsFilteredUntilNodes

func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection

func (*Selection) ParentsFilteredUntilSelection

func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection

func (*Selection) ParentsMatcher

func (s *Selection) ParentsMatcher(m Matcher) *Selection

func (*Selection) ParentsMatcherUntilNodes

func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection

func (*Selection) ParentsMatcherUntilSelection

func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection

func (*Selection) ParentsUntil

func (s *Selection) ParentsUntil(selector string) *Selection

func (*Selection) ParentsUntilMatcher

func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection

func (*Selection) ParentsUntilNodes

func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection

func (*Selection) ParentsUntilSelection

func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection

func (*Selection) Prepend

func (s *Selection) Prepend(selector string) *Selection

func (*Selection) PrependHtml

func (s *Selection) PrependHtml(htmlStr string) *Selection

func (*Selection) PrependMatcher

func (s *Selection) PrependMatcher(m Matcher) *Selection

func (*Selection) PrependNodes

func (s *Selection) PrependNodes(ns ...*html.Node) *Selection

func (*Selection) PrependSelection

func (s *Selection) PrependSelection(sel *Selection) *Selection

func (*Selection) Prev

func (s *Selection) Prev() *Selection

func (*Selection) PrevAll

func (s *Selection) PrevAll() *Selection

func (*Selection) PrevAllFiltered

func (s *Selection) PrevAllFiltered(selector string) *Selection

func (*Selection) PrevAllMatcher

func (s *Selection) PrevAllMatcher(m Matcher) *Selection

func (*Selection) PrevFiltered

func (s *Selection) PrevFiltered(selector string) *Selection

func (*Selection) PrevFilteredUntil

func (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection

func (*Selection) PrevFilteredUntilMatcher

func (s *Selection) PrevFilteredUntilMatcher(filter, until Matcher) *Selection

func (*Selection) PrevFilteredUntilNodes

func (s *Selection) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection

func (*Selection) PrevFilteredUntilSelection

func (s *Selection) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection

func (*Selection) PrevMatcher

func (s *Selection) PrevMatcher(m Matcher) *Selection

func (*Selection) PrevMatcherUntilNodes

func (s *Selection) PrevMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection

func (*Selection) PrevMatcherUntilSelection

func (s *Selection) PrevMatcherUntilSelection(filter Matcher, sel *Selection) *Selection

func (*Selection) PrevUntil

func (s *Selection) PrevUntil(selector string) *Selection

func (*Selection) PrevUntilMatcher

func (s *Selection) PrevUntilMatcher(m Matcher) *Selection

func (*Selection) PrevUntilNodes

func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection

func (*Selection) PrevUntilSelection

func (s *Selection) PrevUntilSelection(sel *Selection) *Selection

func (*Selection) Remove

func (s *Selection) Remove() *Selection

func (*Selection) RemoveAttr

func (s *Selection) RemoveAttr(attrName string) *Selection

func (*Selection) RemoveClass

func (s *Selection) RemoveClass(class ...string) *Selection

func (*Selection) RemoveFiltered

func (s *Selection) RemoveFiltered(selector string) *Selection

func (*Selection) RemoveMatcher

func (s *Selection) RemoveMatcher(m Matcher) *Selection

func (*Selection) ReplaceWith

func (s *Selection) ReplaceWith(selector string) *Selection

func (*Selection) ReplaceWithHtml

func (s *Selection) ReplaceWithHtml(htmlStr string) *Selection

func (*Selection) ReplaceWithMatcher

func (s *Selection) ReplaceWithMatcher(m Matcher) *Selection

func (*Selection) ReplaceWithNodes

func (s *Selection) ReplaceWithNodes(ns ...*html.Node) *Selection

func (*Selection) ReplaceWithSelection

func (s *Selection) ReplaceWithSelection(sel *Selection) *Selection

func (*Selection) SetAttr

func (s *Selection) SetAttr(attrName, val string) *Selection

func (*Selection) SetHtml

func (s *Selection) SetHtml(htmlStr string) *Selection

func (*Selection) SetText

func (s *Selection) SetText(text string) *Selection

func (*Selection) Siblings

func (s *Selection) Siblings() *Selection

func (*Selection) SiblingsFiltered

func (s *Selection) SiblingsFiltered(selector string) *Selection

func (*Selection) SiblingsMatcher

func (s *Selection) SiblingsMatcher(m Matcher) *Selection

func (*Selection) Size

func (s *Selection) Size() int

func (*Selection) Slice

func (s *Selection) Slice(start, end int) *Selection

func (*Selection) Text

func (s *Selection) Text() string

func (*Selection) ToggleClass

func (s *Selection) ToggleClass(class ...string) *Selection

func (*Selection) Union

func (s *Selection) Union(sel *Selection) *Selection

func (*Selection) Unwrap

func (s *Selection) Unwrap() *Selection

func (*Selection) Wrap

func (s *Selection) Wrap(selector string) *Selection

func (*Selection) WrapAll

func (s *Selection) WrapAll(selector string) *Selection

func (*Selection) WrapAllHtml

func (s *Selection) WrapAllHtml(htmlStr string) *Selection

func (*Selection) WrapAllMatcher

func (s *Selection) WrapAllMatcher(m Matcher) *Selection

func (*Selection) WrapAllNode

func (s *Selection) WrapAllNode(n *html.Node) *Selection

func (*Selection) WrapAllSelection

func (s *Selection) WrapAllSelection(sel *Selection) *Selection

func (*Selection) WrapHtml

func (s *Selection) WrapHtml(htmlStr string) *Selection

func (*Selection) WrapInner

func (s *Selection) WrapInner(selector string) *Selection

func (*Selection) WrapInnerHtml

func (s *Selection) WrapInnerHtml(htmlStr string) *Selection

func (*Selection) WrapInnerMatcher

func (s *Selection) WrapInnerMatcher(m Matcher) *Selection

func (*Selection) WrapInnerNode

func (s *Selection) WrapInnerNode(n *html.Node) *Selection

func (*Selection) WrapInnerSelection

func (s *Selection) WrapInnerSelection(sel *Selection) *Selection

func (*Selection) WrapMatcher

func (s *Selection) WrapMatcher(m Matcher) *Selection

func (*Selection) WrapNode

func (s *Selection) WrapNode(n *html.Node) *Selection

func (*Selection) WrapSelection

func (s *Selection) WrapSelection(sel *Selection) *Selection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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