navigation

package
v2.0.0-...-69f43c3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 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 Depth

type Depth struct{}

Depth is the depth of a navigation

type Request

type Request struct {
	Method       string
	URL          string
	Body         string
	Depth        int
	Headers      map[string]string
	Tag          string
	Attribute    string
	RootHostname string
	Source       string // source is the source of the request

	CustomFields map[string][]string // customField matched output
}

Request is a navigation request for the crawler

func NewNavigationRequestURLFromResponse

func NewNavigationRequestURLFromResponse(path, source, tag, attribute string, resp Response) Request

newNavigationRequestURL generates a navigation request from a relative URL

func (*Request) RequestURL

func (n *Request) RequestURL() string

RequestURL returns the request URL for the navigation

type Response

type Response struct {
	Resp         *http.Response
	Depth        int
	Reader       *goquery.Document
	Body         []byte
	RootHostname string

	Options *types.CrawlerOptions
}

Response is a response generated from crawler navigation

func (Response) AbsoluteURL

func (n Response) AbsoluteURL(path string) string

AbsoluteURL parses the path returning a string.

It returns a blank string if the item is invalid, not in-scope or can't be formatted.

func (Response) ValidateScope

func (n Response) ValidateScope(absURL string) (bool, error)

ValidateScope validates scope for an AbsURL

Jump to

Keyboard shortcuts

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