forked from k4s/phantomgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowseParam.go
68 lines (63 loc) · 1.44 KB
/
browseParam.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
package phantomgo
import (
"net/http"
"time"
)
//供内部调用
//interior interface
type Request interface {
GetMethod() string
GetUrl() string
GetHeader() http.Header
GetPostBody() string
GetRedirectTimes() int
GetDialTimeout() time.Duration
GetConnTimeout() time.Duration
GetRetryPause() time.Duration
GetTryTimes() int
GetusePhantomJS() bool
}
//供外部调用
//external interface
type Param struct {
Method string
Url string
Header http.Header
PostBody string
RedirectTimes int //request redirect times allow 重定向次数
DialTimeout time.Duration
ConnTimeout time.Duration
RetryPause time.Duration //if request failed,retry time
TryTimes int //if request failed,retry times
UsePhantomJS bool
}
func (self *Param) GetMethod() string {
return self.Method
}
func (self *Param) GetUrl() string {
return self.Url
}
func (self *Param) GetHeader() http.Header {
return self.Header
}
func (self *Param) GetPostBody() string {
return self.PostBody
}
func (self *Param) GetRedirectTimes() int {
return self.RedirectTimes
}
func (self *Param) GetDialTimeout() time.Duration {
return self.DialTimeout
}
func (self *Param) GetConnTimeout() time.Duration {
return self.ConnTimeout
}
func (self *Param) GetRetryPause() time.Duration {
return self.RetryPause
}
func (self *Param) GetTryTimes() int {
return self.TryTimes
}
func (self *Param) GetusePhantomJS() bool {
return self.UsePhantomJS
}