-
Notifications
You must be signed in to change notification settings - Fork 1
/
threats.go
46 lines (41 loc) · 1.08 KB
/
threats.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package pulsedive
import (
"net/url"
"strconv"
)
// ThreatByID implement api Threats By Threat ID
func ThreatByID(id int) ([]byte, error) {
q := url.Values{}
q.Add("tid", strconv.Itoa(id))
q.Add("pretty", pretty)
q.Add("key", apiKey)
return Get(q.Encode(), "/info.php")
}
// ThreatByName implement api Threats By Threat Name
func ThreatByName(name string) ([]byte, error) {
q := url.Values{}
q.Add("threat", name)
q.Add("pretty", pretty)
q.Add("key", apiKey)
return Get(q.Encode(), "/info.php")
}
// ThreatSummary implement api Threats By Threats Indicator Summary
func ThreatSummary(id int) ([]byte, error) {
q := url.Values{}
q.Add("tid", strconv.Itoa(id))
q.Add("get", "links")
q.Add("summary", "1")
q.Add("splitrisk", "1")
q.Add("pretty", pretty)
q.Add("key", apiKey)
return Get(q.Encode(), "/info.php")
}
// ThreatLink implement api Threats By Threats Linked Indicators
func ThreatLink(id int) ([]byte, error) {
q := url.Values{}
q.Add("tid", strconv.Itoa(id))
q.Add("get", "links")
q.Add("pretty", pretty)
q.Add("key", apiKey)
return Get(q.Encode(), "/info.php")
}