linkcheck

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 9 Imported by: 0

README

linkcheck

Checker for not working links on site

Usage

Prerequisites

  • Go 1.16

Example

go run cmd/main.go -url https://golang.org

Or can be used as package for checking whole site

linkcheck.New(htmlOnlyParam).Start(url)

where:
url - string, site url for check
htmlOnlyParam - bool, load only .html pages or all

Also can be used for check separate page

results, err := linkcheck.New(htmlOnlyParam).Check(pageURL)
if err != nil {
  fmt.Println(err)
}
for from, state := range results {
  fmt.Printf("%s : %s \n", state, from)
}

where:
pageURL - string, page url for check
htmlOnlyParam - bool, load only .html pages or all

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Start(url string)
	Check(url string) (map[string]string, error)
}

func New

func New(htmlOnly bool) Checker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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