Crawler

package
v0.0.0-...-2f20572 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllLinks = AllLinksMap{Links: make(map[string]Link)}

Functions

func Crawl

func Crawl(StartingURL string, wg *sync.WaitGroup)

Crawl through a URL, making a note of all External and Internal Links.

func Go

func Go(MaxNumberOfGoRoutines int)

Start the Crawler

func PadRight

func PadRight(str, pad string, lenght int) string

func Results

func Results()

func ResultsJSON

func ResultsJSON() ([]byte, error)

Types

type AllLinksMap

type AllLinksMap struct {
	Links map[string]Link
	Mux   sync.Mutex
}

func (*AllLinksMap) Add

func (l *AllLinksMap) Add(URL string)

Add a URL to the LinkMap

func (*AllLinksMap) GetLinkMap

func (l *AllLinksMap) GetLinkMap() map[string]Link

func (*AllLinksMap) Update

func (l *AllLinksMap) Update(URL string, TotalLinks int)

Update a URL already in the LinkMap

type Link struct {
	Visited    bool
	TotalLinks int
}

Jump to

Keyboard shortcuts

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