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

Support option for headerXRequestID #8

Merged
merged 2 commits into from
Apr 17, 2022
Merged

Support option for headerXRequestID #8

merged 2 commits into from
Apr 17, 2022

Conversation

shuntagami
Copy link
Contributor

@shuntagami shuntagami commented Apr 17, 2022

What

SSIA

Why

Adding option for declaring header key is helpful. For example, in the case we want to call other micro services from gin framework and propagate request id to the services.

@shuntagami shuntagami changed the title chore: Support option for headerXRequestID Support option for headerXRequestID Apr 17, 2022
if rid == "" {
rid = cfg.generator()
// Set the id to ensure that the requestid is in the request
c.Request.Header.Add(headerXRequestID, rid)
Copy link
Contributor Author

@shuntagami shuntagami Apr 17, 2022

Choose a reason for hiding this comment

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

duplicating line 41, so deleted.

@shuntagami
Copy link
Contributor Author

@appleboy Review plz.

@appleboy appleboy added the enhancement New feature or request label Apr 17, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2022

Codecov Report

Merging #8 (97c44f2) into master (941abc2) will increase coverage by 1.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage   91.66%   92.85%   +1.19%     
==========================================
  Files           2        2              
  Lines          24       28       +4     
==========================================
+ Hits           22       26       +4     
  Misses          2        2              
Flag Coverage Δ
go- 92.85% <100.00%> (+1.19%) ⬆️
go-1.14 92.85% <100.00%> (+1.19%) ⬆️
go-1.15 92.85% <100.00%> (+1.19%) ⬆️
go-1.16 92.85% <100.00%> (+1.19%) ⬆️
go-1.17 92.85% <100.00%> (+1.19%) ⬆️
go-1.18 92.85% <100.00%> (+1.19%) ⬆️
macos-latest 92.85% <100.00%> (+1.19%) ⬆️
ubuntu-latest 92.85% <100.00%> (+1.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
options.go 100.00% <100.00%> (ø)
requestid.go 90.00% <100.00%> (ø)

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 941abc2...97c44f2. Read the comment docs.

@appleboy appleboy merged commit 679ae72 into gin-contrib:master Apr 17, 2022
@appleboy
Copy link
Member

See https://github.com/gin-contrib/requestid/releases/tag/v0.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants