utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FilenamePtr   *string
	VerbosePtr    *bool
	JSONPtr       *bool
	IgnoreFilePtr *bool
)

flag globals

Functions

func GetIgnorePatterns

func GetIgnorePatterns(ignoreFilePath string, urlRegex *regexp.Regexp, ipRegex *regexp.Regexp) []string

GetIgnorePatterns creates a slice of URLs to ignore from the file string passed

func IgnoreURL

func IgnoreURL(urls []string, ignoreList []string) []string

IgnoreURL goes through the url list and removes any url that matches with the ignore url list

func RemoveDuplicate

func RemoveDuplicate(urls []string) []string

RemoveDuplicate removes duplicate strings from a slice of strings

Types

type RequestResult

type RequestResult struct {
	URL    string `json:"url"`
	Status int    `json:"status"`
}

RequestResult is a struct for storing urls and status codes

func CheckLink(wg *sync.WaitGroup, url string) (RequestResult, int, error)

CheckLink makes a request to a URL passed and returns it's status

Jump to

Keyboard shortcuts

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