feat: Add an option to specify headers#1096
Open
kayoch1n wants to merge 3 commits intohibiken:masterfrom
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1096 +/- ##
==========================================
- Coverage 67.13% 63.33% -3.81%
==========================================
Files 29 29
Lines 4300 5010 +710
==========================================
+ Hits 2887 3173 +286
- Misses 1135 1558 +423
- Partials 278 279 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| func (h headerOption) Type() OptionType { return HeaderOpt } | ||
| func (h headerOption) Value() interface{} { return [2]string{h[0], h[1]} } | ||
|
|
||
| func Headers(headers map[string]string) (ret []Option) { |
Collaborator
There was a problem hiding this comment.
Could we rename this to something else like HeadersMap so that it is not confusing. #1070 also introduced a Headers method on Task.
Collaborator
|
Maybe another thing to document is when to use this vs what was introduced in #1070. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
Header()option to the Client API, allowing users to associate key-value headers to tasks.Header(key, value string) Optionfunction to client.go.The underlying value of
Headeris[2]string. Inspector parses Header option by unmarshaling the JSON array argument back to[2]stringusage:
Follow-up to #1070 which added headers support to Task messages