-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add config marshaler. #5566
Add config marshaler. #5566
Conversation
Codecov ReportBase: 91.77% // Head: 91.87% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #5566 +/- ##
==========================================
+ Coverage 91.77% 91.87% +0.10%
==========================================
Files 218 219 +1
Lines 13364 13533 +169
==========================================
+ Hits 12265 12434 +169
Misses 870 870
Partials 229 229
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to press submit, sorry.
ae602a6
to
04defbf
Compare
@bogdandrutu PTAL when you get the chance. Refactored the marshaler to be more similar to the unmarshaler. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
04defbf
to
d08c977
Compare
Changed the |
d08c977
to
58921ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I am all focus on this PR now :)
58921ec
to
72f6ec8
Compare
6403a98
to
92822b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why the Encoder is still needed.
The Encoder handles all of the reflection needed to respect the mapstructure tags and is used by confmap to marshal. Without it, the marshal/unmarshal cycle would break and the configs being generated would be invalid. |
92822b6
to
74c9331
Compare
Then the dependency graph is totally unexpected. Move that to |
0313fc1
to
468aecd
Compare
Moved under |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
468aecd
to
81934ee
Compare
81934ee
to
7d1b633
Compare
7d1b633
to
deeacb6
Compare
Description:
Add
Marshal
function toconfmap
. Update types implementingencoding.TextUnmarshaler
to implementencoding.TextMarshaler
as well. Add a mapstructure encoder that encodes the config provided using the existing mapstructure tags.Link to tracking Issue: #5418
Testing: Added unit test to validate the unmarshal/marshal cycle.