-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
47 lines (42 loc) · 1.04 KB
/
types.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
47
package types
import (
"os"
"time"
)
const (
OneK = 1 << 10
OneMeg = 1 << 20
TwoGigs = OneGig * 2
QuarterGig = 256 * OneMeg
HalfGig = QuarterGig * 2
OneGig = HalfGig * 2
MaxDomainsInMap = 1024
TickEvery = 10 * time.Second
Parallelism = 2
RandomDelay = 60 * time.Second
APIRetryMax = 3
//
ReadTimeout = 30 * time.Second
WriteTimeout = 30 * time.Second
IdleTimeout = 60 * time.Second
//
GetDomainsRetry = 60 * time.Second
// process control.
CrawlerExtra = 10 * time.Second
KillSleep = 3 * time.Second
CrawlFilterRetry = 60 * time.Second
HeadCheckTimeout = 10 * time.Second
// process limits.
CrawlerMaxRunTime = 600 * time.Second
)
var (
FreyaKey = os.Getenv("FREYA") // nolint:gochecknoglobals
APIBase = "https://api.domainsproject.org/api/vo" // nolint:gochecknoglobals
)
type DomainsResponse struct {
Domains []string `json:"domains"`
}
type JSONResponse struct {
Code int64 `json:"code"`
Message string `json:"message"`
}