File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,17 @@ func (c *Client) Geocode() *Geocode {
51
51
return & Geocode {c }
52
52
}
53
53
54
- func (c * Client ) Post () * Post {
55
- return & Post {c }
54
+ func (c * Client ) Email () * Email {
55
+ return & Email {c }
56
56
}
57
57
58
- func (c * Client ) Download (id string , path string ) (err * APIError ) {
59
- _ , e := c .resty .R ().
58
+ func (c * Client ) Download (id string , path string ) (ae * APIError ) {
59
+ _ , err := c .resty .R ().
60
60
SetOutput (path ).
61
61
Get (fmt .Sprintf ("%s/download/%s" , apiURL , id ))
62
- if e != nil {
63
- err = new (APIError )
64
- err .Message = e .Error ()
62
+ if err != nil {
63
+ ae = new (APIError )
64
+ ae .Message = err .Error ()
65
65
}
66
66
return
67
67
}
Original file line number Diff line number Diff line change 1
1
package labstack
2
2
3
3
type (
4
- Post struct {
4
+ Email struct {
5
5
* Client
6
6
}
7
7
8
- PostVerifyResponse struct {
8
+ EmailVerifyResponse struct {
9
9
ValidSyntax bool `json:"valid_syntax"`
10
10
Deliverable bool `json:"deliverable"`
11
11
InboxFull bool `json:"inbox_full"`
@@ -15,23 +15,23 @@ type (
15
15
}
16
16
)
17
17
18
- func (p * Post ) Verify (email string ) (* PostVerifyResponse , * APIError ) {
19
- res := new (PostVerifyResponse )
20
- err := new (APIError )
21
- r , e := p .resty .R ().
18
+ func (e * Email ) Verify (email string ) (* EmailVerifyResponse , * APIError ) {
19
+ res := new (EmailVerifyResponse )
20
+ ae := new (APIError )
21
+ r , err := e .resty .R ().
22
22
SetQueryParams (map [string ]string {
23
23
"email" : email ,
24
24
}).
25
25
SetResult (res ).
26
- SetError (err ).
26
+ SetError (ae ).
27
27
Get ("/post/verify" )
28
- if e != nil {
28
+ if err != nil {
29
29
return nil , & APIError {
30
- Message : e .Error (),
30
+ Message : err .Error (),
31
31
}
32
32
}
33
- if p .error (r ) {
34
- return nil , err
33
+ if e .error (r ) {
34
+ return nil , ae
35
35
}
36
36
return res , nil
37
37
}
You can’t perform that action at this time.
0 commit comments