-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.go
More file actions
43 lines (34 loc) · 971 Bytes
/
options.go
File metadata and controls
43 lines (34 loc) · 971 Bytes
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
// file: options.go
// description: defines options for the FQDN manager
package gotld
import (
"context"
"net/http"
"time"
)
// Options for the FQDN Manager
type Options struct {
// AllowPrivateTLDs determines whether private TLDs are allowed
AllowPrivateTLDs bool
// Timeout for HTTP requests
Timeout time.Duration
// CustomHTTPClient allows setting a custom HTTP client
CustomHTTPClient *http.Client
// PublicSuffixURL is the URL to download the public suffix list from
PublicSuffixURL string
// PublicSuffixFile is a local file containing the public suffix list
PublicSuffixFile string
// Context is used for cancellation
Context context.Context
}
// DefaultOptions returns default options
func DefaultOptions() *Options {
return &Options{
AllowPrivateTLDs: false,
Timeout: 10 * time.Second,
CustomHTTPClient: nil,
PublicSuffixURL: publicSuffixFileURL,
PublicSuffixFile: "",
Context: context.Background(),
}
}