-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
92 lines (78 loc) · 2.15 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package http
import (
"io"
"time"
fhttp "github.com/vimbing/fhttp"
"github.com/vimbing/fhttp/cookiejar"
"github.com/vimbing/fhttp/http2"
"github.com/vimbing/retry"
tls "github.com/vimbing/vutls"
)
type OptionStringJa string
type OptionTimeout time.Duration
type OptionProxy string
type OptionDisallowRedirect bool
type OptionForcedProxyRotation bool
type OptionUtlsJa3HelloId tls.ClientHelloID
type OptionUtlsJa3HelloSpec tls.ClientHelloSpec
type OptionTlsProfile TlsProfile
type OptionInsecureSkipVerify bool
type OptionCookieJar *cookiejar.Jar
type OptionRequestMiddleware []RequestMiddlewareFunc
type OptionResponseMiddleware []ResponseMiddlewareFunc
type OptionResponseErrorMiddleware []ResponseErrorMiddlewareFunc
type OptionHttpSettings Http2Settings
type Client struct {
fhttpClient *fhttp.Client
cfg *Config
}
type RequestMiddlewareFunc func(*Request) error
type ResponseMiddlewareFunc func(*Response) error
type ResponseErrorMiddlewareFunc func(*Request, error)
type Http2Settings struct {
Order []http2.SettingID
Settings map[http2.SettingID]uint32
DisablePush bool
}
type Config struct {
insecureSkipVerify bool
requestMiddleware []RequestMiddlewareFunc
responseMiddleware []ResponseMiddlewareFunc
responseErrorMiddleware []ResponseErrorMiddlewareFunc
proxies []string
forceRotation bool
allowRedirect bool
timeout time.Duration
ja3 tls.ClientHelloID
tlsProfile *TlsProfile
jar *cookiejar.Jar
httpSettings Http2Settings
}
type RequestJsonBody any
type QueryParams map[string]string
type FormUrlEncoded map[string]string
type Request struct {
Method string
Body io.Reader
Header fhttp.Header
Url string
protoMinor int
protoMajor int
proto string
host *string
retrier *retry.Retrier
tlsProfile *TlsProfile
fhttpRequest *fhttp.Request
}
type Response struct {
Body []byte
fhttpResponse *fhttp.Response
}
type TlsProfile struct {
Http2Settings Http2Settings
Ja3 tls.ClientHelloID
}
type requestExecutionResult struct {
res *Response
error error
}