Documentation
¶
Index ¶
- Variables
- func SetReverseResolver(...)
- type Entity
- func (e *Entity) EnableReverseResolving()
- func (e *Entity) FetchData()
- func (e *Entity) GetASN() (uint, bool)
- func (e *Entity) GetCountry() (string, bool)
- func (e *Entity) GetDomain() (string, bool)
- func (e *Entity) GetIP() (net.IP, bool)
- func (e *Entity) GetLists() ([]string, bool)
- func (e *Entity) GetListsMap() (filterlists.LookupMap, bool)
- func (e *Entity) GetLocation() (*geoip.Location, bool)
- func (e *Entity) Init() *Entity
- func (e *Entity) ResetLists()
- func (e *Entity) ResolveSubDomainLists(enabled bool)
- type ListSet
Constants ¶
This section is empty.
Variables ¶
var ( // Module of this package. Export needed for testing of the endpoints package. Module *modules.Module )
Functions ¶
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) GetCountry ¶ added in v0.4.0
GetCountry returns the two letter ISO country code and whether it is set.
func (*Entity) GetLists ¶ added in v0.4.0
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
GetLocation returns the raw location data and whether it is set.
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
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
NewListSet returns a new ListSet with the given list IDs.