links

package
v0.0.0-...-f4b44f0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckURL

func CheckURL(url ParsingURL) (*http.Response, *html.Node, error)

CheckURL checks passed url in arguments and returns specified error if it is incorrect.

func ForEachNode

func ForEachNode(node *html.Node, f func(n *html.Node))

ForEachNode recursive runs throw DOM tree and finds links.

func NewBadStatusCodeError

func NewBadStatusCodeError(url ParsingURL, statusCode int) error

func NewInvalidResponseTypeError

func NewInvalidResponseTypeError(url ParsingURL) error

func NewUnreachableSiteError

func NewUnreachableSiteError(url ParsingURL) error

Types

type BrokenURL

type BrokenURL struct {
	ParsingURL       // Link URL
	Error      error // Error of link
}

BrokenURL is type for broken links.

func FindBrokenLinks(baseURL ParsingURL) []BrokenURL

FindBrokenLinks finds broken links on site and returns array of type BrokenURL as result.

type ParsingURL

type ParsingURL string

ParsingURL is type-wrapper over string for links.

func Extract

func Extract(response *http.Response, doc *html.Node) []ParsingURL

Extract extracts all links from passed URL.

Jump to

Keyboard shortcuts

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