linkscanner

package module
v0.0.0-...-4c7a091 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

README

linkscanner

Build Status GoDoc Go Report Card

A helper package to tokenize textual content and retrieve hyperlinks

License

GNU General Public License Version 3. Full Text

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixWWW

func FixWWW(f bool)

FixWWW enables the override of the default setting in this package to fix wwww links where there isn't a protocol specified, e.g. http://

func GetVersion

func GetVersion() string

GetVersion returns the version of the package to the calling code.

func HTTPScanner

func HTTPScanner(content string) ([]string, []error)

HTTPScanner expects a length of text as input and returns two slices Dependant on what it discovers. First a unique list of URLs parsed successfully by net/url. Second a list of errors that were encountered trying to parse the URL found in the text.

func HTTPScannerIndex

func HTTPScannerIndex(content string) ([]map[int]string, []error)

HTTPScannerIndex provides the same basic functionality of HTTPScanner. The number of words scanned is monitored. This count becomes an position integer providing an approximate index in the text where the hyper-link was found. The returned value is not a zero-based index.

func ListProtocols

func ListProtocols() []string

ListProtocols returns to the caller a list of protocols that we're testing for when scanning text.

func LoadExtensions

func LoadExtensions(extensions []string)

LoadExtensions enables linkscanner to look beyond the default protocols that are specified in the library.

Types

This section is empty.

Jump to

Keyboard shortcuts

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