risk

package
v0.0.0-...-57b459a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlackList

type BlackList interface {
	HasURL(url string) (bool, error)
}

BlackList checks whether an item is acceptable

type BlackListFake

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

BlackListFake is a in memory implementation of a BlackList used for testing.

func NewBlackListFake

func NewBlackListFake(blacklist map[string]bool) BlackListFake

NewBlackListFake initializes an in-memory blacklist.

func (BlackListFake) HasURL

func (b BlackListFake) HasURL(url string) (bool, error)

HasURL checks whether a given url exists in the blacklist.

type Detector

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

Detector determines whether the given items are malicious.

func NewDetector

func NewDetector(blacklist BlackList) Detector

NewDetector creates a new Detector

func (Detector) IsURLMalicious

func (r Detector) IsURLMalicious(url string) bool

IsURLMalicious checks whether the given URL is malicious.

Jump to

Keyboard shortcuts

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