Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
wb
gocrawlhq
Commits
477a662f
Commit
477a662f
authored
Dec 12, 2021
by
Corentin Barreau
⚜
Browse files
Fix: Feed endpoint, pass size as query param
parent
4549a671
Changes
2
Hide whitespace changes
Inline
Side-by-side
feed.go
View file @
477a662f
...
...
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strconv"
)
func
(
c
*
Client
)
Feed
(
size
int
)
(
feedResponse
*
FeedResponse
,
err
error
)
{
...
...
@@ -16,6 +17,10 @@ func (c *Client) Feed(size int) (feedResponse *FeedResponse, err error) {
return
feedResponse
,
err
}
q
:=
req
.
URL
.
Query
()
q
.
Add
(
"size"
,
strconv
.
Itoa
(
size
))
req
.
URL
.
RawQuery
=
q
.
Encode
()
req
.
Header
.
Add
(
"X-Auth-Key"
,
c
.
Key
)
req
.
Header
.
Add
(
"X-Auth-Secret"
,
c
.
Secret
)
req
.
Header
.
Add
(
"User-Agent"
,
"gocrawlhq/"
+
Version
)
...
...
gocrawlhq.go
View file @
477a662f
...
...
@@ -40,7 +40,7 @@ func Init(key, secret, project, HQAddress string) (c *Client, err error) {
DiscoveredEndpoint
.
Path
=
path
.
Join
(
DiscoveredEndpoint
.
Path
,
"discovered"
)
FinishedEndpoint
.
Path
=
path
.
Join
(
FinishedEndpoint
.
Path
,
"finished"
)
FeedEndpoint
.
Path
=
path
.
Join
(
FeedEndpoint
.
Path
,
"feed"
)
FeedEndpoint
.
Path
=
path
.
Join
(
FeedEndpoint
.
Path
,
"feed"
,
c
.
Project
)
return
c
,
nil
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment