linkcheck

package
v3.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package linkcheck implements a helper library to search for links in a message text and validate them by trying to call them

Index

Constants

View Source
const (
	// DefaultCheckTimeout defines the default time the request to a site
	// may take to answer
	DefaultCheckTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker contains logic to detect and resolve links in a message

func New

func New(opts ...func(*Checker)) *Checker

New creates a new Checker instance with default settings

func (c Checker) HeuristicScanForLinks(message string) []string

HeuristicScanForLinks takes a message and tries to find links within that message. Common methods like putting spaces into links are tried to circumvent.

func (c Checker) ScanForLinks(message string) (links []string)

ScanForLinks takes a message and tries to find links within that message. This only detects links without any means of obfuscation like putting spaces into the link.

Jump to

Keyboard shortcuts

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