
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
Fingerprints is a user detection library intended to aid in finding spam accounts
func ExampleNew() {
var err error
if testController, err = New("./data"); err != nil {
log.Fatal(err)
}
}
func ExampleController_New() {
var (
i Identifiers
err error
)
i.IPAddress = "64.233.191.255"
i.UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
i.AcceptLanguage = "en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7"
if err = testController.New(context.Background(), "user_0", i); err != nil {
log.Fatal(err)
}
}
func ExampleController_GetByIP() {
var (
es []*Entry
err error
)
if es, err = testController.GetByIP("[IP Address]"); err != nil {
log.Fatal(err)
}
fmt.Println("Matching entries", es)
}
func ExampleController_GetByUserAgent() {
var (
es []*Entry
err error
)
if es, err = testController.GetByUserAgent("[User Agent]"); err != nil {
log.Fatal(err)
}
fmt.Println("Matching entries", es)
}
func ExampleController_GetMatches() {
var (
i Identifiers
es []*Entry
err error
)
i.IPAddress = "64.233.191.255"
i.UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
i.AcceptLanguage = "en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7"
if es, err = testController.GetMatches(i); err != nil {
log.Fatal(err)
}
fmt.Println("Matching entries", es)
}
func ExampleController_GetMatches_ip_only() {
var (
i Identifiers
es []*Entry
err error
)
i.IPAddress = "64.233.191.255"
if es, err = testController.GetMatches(i); err != nil {
log.Fatal(err)
}
fmt.Println("Matching entries", es)
}
func ExampleController_GetMatches_user_agent_only() {
var (
i Identifiers
es []*Entry
err error
)
i.UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
if es, err = testController.GetMatches(i); err != nil {
log.Fatal(err)
}
fmt.Println("Matching entries", es)
}
func ExampleController_GetDuplicates() {
var (
dups map[string]stringset.Map
err error
)
if dups, err = testController.GetDuplicates(); err != nil {
log.Fatal(err)
}
fmt.Println("Duplicates", dups)
}
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.