check

package
v0.0.0-...-b474970 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package check provides checking for various URLs. Check is selected based on the URL schema or by calling directly the check function for given schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FTP

func FTP(link models.Link) (models.Fix, error)

func File

func File(link models.Link) (models.Fix, error)

func HTTP

func HTTP(ctx context.Context, link models.Link) (models.Fix, error)

func MailTo

func MailTo(link models.Link) (models.Fix, error)

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker checks links for availability and finds replacements if necessary.

func NewChecker

func NewChecker(exclude []string) *Checker

NewChecker creates new checker for link checking.

func (*Checker) ProcessURL

func (c *Checker) ProcessURL(ctx context.Context, link models.Link) (models.Fix, error)

ProcessURL processes given URL, checking whether it works and in case it doesn't finding its snapshot on Wayback machine.

type Lister

type Lister interface {
	// List lists all links from given source.
	List() ([]models.Link, error)
}

Lister is interface to sources that can list links.

Jump to

Keyboard shortcuts

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