Skip to content

Commit c8f9648

Browse files
committed
Updated domain/search
Signed-off-by: Vishal Rana <[email protected]>
1 parent 3c3ffe0 commit c8f9648

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

.idea/workspace.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import "os"
44

55
var (
66
client = NewClient(os.Getenv("KEY"))
7-
cs = client.Currency()
8-
ds = client.Domain()
9-
es = client.Email()
10-
is = client.IP()
11-
ws = client.Webpage()
7+
cs = client.Currency()
8+
ds = client.Domain()
9+
es = client.Email()
10+
is = client.IP()
11+
ws = client.Webpage()
1212
)

domain.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ func (d *DomainService) Search(req *domain.SearchRequest) (*domain.SearchRespons
3737
res := new(domain.SearchResponse)
3838
err := new(Error)
3939
r, e := d.resty.R().
40-
SetPathParams(map[string]string{
41-
"domain": req.Domain,
42-
}).
40+
SetQueryParam("q", req.Q).
4341
SetResult(res).
4442
SetError(err).
45-
Get("/search/{domain}")
43+
Get("/search")
4644
if e != nil {
4745
return nil, &Error{
4846
Message: err.Error(),

domain/domain.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type (
6161
}
6262

6363
SearchRequest struct {
64-
Domain string
64+
Q string
6565
}
6666

6767
SearchResponse struct {

domain_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package labstack
22

33
import (
4+
"testing"
5+
46
"github.com/labstack/labstack-go/domain"
57
"github.com/stretchr/testify/assert"
6-
"testing"
78
)
89

910
func TestClient_DNS(t *testing.T) {
@@ -18,7 +19,7 @@ func TestClient_DNS(t *testing.T) {
1819

1920
func TestClient_Search(t *testing.T) {
2021
res, err := ds.Search(&domain.SearchRequest{
21-
Domain: "twilio.com",
22+
Q: "twilio",
2223
})
2324
if assert.Nil(t, err) {
2425
assert.NotZero(t, len(res.Results))

0 commit comments

Comments
 (0)