intel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Module of this package. Export needed for testing of the endpoints package.
	Module *modules.Module
)

Functions

func SetReverseResolver added in v0.4.0

func SetReverseResolver(fn func(ctx context.Context, ip string, securityLevel uint8) (domain string, err error))

SetReverseResolver allows the resolver module to register a function to allow reverse resolving IPs to domains.

Types

type Entity added in v0.4.0

type Entity struct {
	sync.Mutex

	Protocol uint8
	Port     uint16
	Domain   string
	IP       net.IP

	Country string
	ASN     uint

	Lists    []string
	ListsMap filterlists.LookupMap
	// contains filtered or unexported fields
}

Entity describes a remote endpoint in many different ways. It embeddes a sync.Mutex but none of the endpoints own functions performs locking. The caller MUST ENSURE proper locking and synchronization when accessing any properties of Entity.

func (*Entity) EnableReverseResolving added in v0.4.0

func (e *Entity) EnableReverseResolving()

EnableReverseResolving enables reverse resolving the domain from the IP on demand.

func (*Entity) FetchData added in v0.4.0

func (e *Entity) FetchData()

FetchData fetches additional information, meant to be called before persisting an entity record.

func (*Entity) GetASN added in v0.4.0

func (e *Entity) GetASN() (uint, bool)

GetASN returns the AS number and whether it is set.

func (*Entity) GetCountry added in v0.4.0

func (e *Entity) GetCountry() (string, bool)

GetCountry returns the two letter ISO country code and whether it is set.

func (*Entity) GetDomain added in v0.4.0

func (e *Entity) GetDomain() (string, bool)

GetDomain returns the domain and whether it is set.

func (*Entity) GetIP added in v0.4.0

func (e *Entity) GetIP() (net.IP, bool)

GetIP returns the IP and whether it is set.

func (*Entity) GetLists added in v0.4.0

func (e *Entity) GetLists() ([]string, bool)

GetLists returns the filter list identifiers the entity matched and whether this data is set.

func (*Entity) GetListsMap added in v0.4.0

func (e *Entity) GetListsMap() (filterlists.LookupMap, bool)

GetListsMap is like GetLists but returns a lookup map for list IDs.

func (*Entity) GetLocation added in v0.4.0

func (e *Entity) GetLocation() (*geoip.Location, bool)

GetLocation returns the raw location data and whether it is set.

func (*Entity) Init added in v0.4.0

func (e *Entity) Init() *Entity

Init initializes the internal state and returns the entity.

func (*Entity) ResetLists added in v0.4.0

func (e *Entity) ResetLists()

ResetLists resets the current list data and forces all list sources to be re-acquired when calling GetLists().

func (*Entity) ResolveSubDomainLists added in v0.4.0

func (e *Entity) ResolveSubDomainLists(enabled bool)

ResolveSubDomainLists enables or disables list lookups for sub-domains.

type ListSet added in v0.4.0

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

ListSet holds a set of list IDs.

func NewListSet added in v0.4.0

func NewListSet(lists []string) *ListSet

NewListSet returns a new ListSet with the given list IDs.

func (*ListSet) MatchSet added in v0.4.0

func (ls *ListSet) MatchSet(lists []string) (matched []string)

MatchSet returns the matching list IDs.

func (*ListSet) Matches added in v0.4.0

func (ls *ListSet) Matches(lists []string) (matches bool)

Matches returns whether there is a match in the given list IDs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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