favirecon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TLSHandshakeTimeout = 10
	KeepAlive           = 30
	MinURLLength        = 4
)

Variables

View Source
var (
	ErrHashNotFound    = errors.New("hash not found")
	ErrHashNotMatching = errors.New("hash not matching hash provided")
)

nolint: gochecknoglobals

View Source
var (
	ErrMalformedURL  = errors.New("malformed input URL")
	ErrCidrBadFormat = errors.New("malformed input CIDR")
)

Functions

func CheckFavicon

func CheckFavicon(faviconHash string, hash goflags.StringSlice, url ...string) (string, error)

CheckFavicon checks if faviconHash is present in the database. If hash (slice) is not empty, it checks also if that faviconHash is one of the inputted hashes. If faviconHash is not found, an error is returned.

func GetFaviconHash

func GetFaviconHash(input []byte) string

GetFaviconHash computes the murmur3 hash.

func PrepareURL

func PrepareURL(input string) (string, error)

PrepareURL takes as input a string and prepares the input URL in order to get the favicon icon.

Types

type Runner

type Runner struct {
	Input     chan string
	Output    chan output.Found
	Result    output.Result
	UserAgent string
	InWg      *sync.WaitGroup
	OutWg     *sync.WaitGroup
	Options   input.Options
	OutMutex  *sync.Mutex
}

func New

func New(options *input.Options) Runner

New takes as input the options and returns a new runner.

func (*Runner) Run

func (r *Runner) Run()

Run takes the input and executes all the tasks specified in the options.

Jump to

Keyboard shortcuts

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