Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding param options #49

Merged
merged 2 commits into from
Jan 11, 2019
Merged

adding param options #49

merged 2 commits into from
Jan 11, 2019

Conversation

creedasaurus
Copy link
Collaborator

This PR will add functionality to set query parameters on each fetcher request.

Example:

c := context.Background()
  cl, err := fetcher.NewClient(c,
    fetcher.WithRequestOptions([]fetcher.RequestOption{
      fetcher.WithAcceptJSONHeader(),
      fetcher.WithParams("foo", "bar"),
      fetcher.WithParams("baz", "quz"),
    }),
  )

And each subsequent request would be made with the params, properly escaped:
http://example.url.com/path?foo=bar&baz=qux

Also there will be an update to the circleci/reviewdog config.

@codecov
Copy link

codecov bot commented Jan 7, 2019

Codecov Report

Merging #49 into master will increase coverage by 1.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
+ Coverage   42.28%   43.45%   +1.17%     
==========================================
  Files          10       10              
  Lines         674      688      +14     
==========================================
+ Hits          285      299      +14     
  Misses        349      349              
  Partials       40       40
Impacted Files Coverage Δ
request.go 22.67% <100%> (+4.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fceb254...abcd775. Read the comment docs.

client.go Outdated Show resolved Hide resolved
@creedasaurus creedasaurus force-pushed the adding-param-options branch 2 times, most recently from a006608 to e02714d Compare January 11, 2019 01:03
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
log.go Outdated Show resolved Hide resolved
log.go Outdated Show resolved Hide resolved
log.go Outdated Show resolved Hide resolved
log.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@josephbergevin josephbergevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Nice work @creedasaurus

@creedasaurus creedasaurus merged commit f7d5d19 into master Jan 11, 2019
@creedasaurus creedasaurus deleted the adding-param-options branch January 11, 2019 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants