-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstruct.go
39 lines (33 loc) · 1.07 KB
/
struct.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
package godnsbl
import (
"sync"
"time"
)
// LookupService is the main running service
type LookupService struct {
DnsblTimeout string `yaml:"DnsblTimeout" json:"DnsblTimeout"`
DnsblListing []Dnsbl `yaml:"DroneListing" json:"DroneListing"`
StartTime int64
TotalChecked uint64
// We parse DnsblTimeout and store it in an unexported time.Duration so we only have to parse it once
timeout time.Duration
}
// Dnsbl stores the data for each Dnbsl we have
type Dnsbl struct {
Name string `yaml:"Name" json:"Name"`
Address string `yaml:"Address" json:"Address"`
Reply map[string]string `yaml:"Reply" json:"Reply"`
AllowList []int `yaml:"AllowList" json:"AllowList"`
BlockMessage string `yaml:"BlockMessage" json:"BlockMessage"`
}
// DnsblReturn is the standard data format for returning info from a Dnsbl
type DnsblReturn struct {
IP string
Type string
Dnsbl string
Message string
}
type dnsblCounter struct {
ClearCount int // Number that have not matched
sync.RWMutex // Mutex locker
}