Skip to content

Commit 84298dd

Browse files
committed
Post to email
Signed-off-by: Vishal Rana <[email protected]>
1 parent 024a313 commit 84298dd

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

client.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ func (c *Client) Geocode() *Geocode {
5151
return &Geocode{c}
5252
}
5353

54-
func (c *Client) Post() *Post {
55-
return &Post{c}
54+
func (c *Client) Email() *Email {
55+
return &Email{c}
5656
}
5757

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().
6060
SetOutput(path).
6161
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()
6565
}
6666
return
6767
}

post.go renamed to email.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package labstack
22

33
type (
4-
Post struct {
4+
Email struct {
55
*Client
66
}
77

8-
PostVerifyResponse struct {
8+
EmailVerifyResponse struct {
99
ValidSyntax bool `json:"valid_syntax"`
1010
Deliverable bool `json:"deliverable"`
1111
InboxFull bool `json:"inbox_full"`
@@ -15,23 +15,23 @@ type (
1515
}
1616
)
1717

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().
2222
SetQueryParams(map[string]string{
2323
"email": email,
2424
}).
2525
SetResult(res).
26-
SetError(err).
26+
SetError(ae).
2727
Get("/post/verify")
28-
if e != nil {
28+
if err != nil {
2929
return nil, &APIError{
30-
Message: e.Error(),
30+
Message: err.Error(),
3131
}
3232
}
33-
if p.error(r) {
34-
return nil, err
33+
if e.error(r) {
34+
return nil, ae
3535
}
3636
return res, nil
3737
}

0 commit comments

Comments
 (0)