-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(configio): config encoding #66
Draft
GregoryAlbouy
wants to merge
53
commits into
main
Choose a base branch
from
feat/configio-encoding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
- ParseRepresentation -> UnmarshalRepresentation: change signature so it matches json.Unmarshal style - implement Representation.Unmarshal: alias to UnmarshalRepresentation - update JSON accordingly
- remove Config.Override, Config.WithFields, Config.Equal - remove related tests - update tests relying on removed Config methods
Unmarshal -> ParseInto
- run go mod tidy
- module github.com/benchttp/engine -> github.com/benchttp/sdk - package runner -> benchttp
Irrelevant method, use Runner.OnProgress instead.
- simplify with less declarations - move into fie runner.go - more accurate docs
Allows convenient chaining, e.g. when using de default runner: DefaultRunner().WithNewRequest("", "http://a.b", nil).Run(ctx) - Runner.WithRequest - Runner.WithNewRequest
- implement AssertEqualRunners, EqualRunners, DiffRunner - Unit test exposed functions
from benchttp/cli
Rethink exposed API so it matches the native json lib. - replace Parse -> Decode in all declarations and file names - expose top-level unmarshaling & decoding functions: - UnmarshalJSON, UnmarshalYAML: unmarshal bytes into *Representation - UnmarshalJSONRunner, UnmarshalYAMLRunner: same into *benchttp.Runner - NewJSONDecoder, NewYAMLDecoder: same as json.NewDecoder - DecoderOf: returns appropriate Decoder given an extension
Clarity over humor
- make testdata more robust easy to reason about using a dedicated package - use table testing - use benchttptest for runner comparison - extract assertXxx helpers
Do not expose testdata.
- use dedicated data structure (file) - rethink namings - move functions to appropriate places
…ilder" This reverts commit 731547e.
Previous benchmarks showed 2.5x better performance over piped modifier.
- Builder.Into -> Builder.Mutate - Builder.modifiers -> Builder.mutations
- configio.Representation -> configio.representation - make all representation methods private
- remove Decode methods from interface Decoder and its implementations - rename DecodeRunner methods to Decode - remove UnmarshalXXXX functions - rename UnmarshalXXXXRunner functions to UnmarshalXXXX
- configio.representation -> configio/internal/Repr - expose necessary methods
Codecov Report
@@ Coverage Diff @@
## feat/configio-builder #66 +/- ##
=========================================================
- Coverage 81.64% 81.50% -0.14%
=========================================================
Files 29 31 +2
Lines 1024 1065 +41
=========================================================
+ Hits 836 868 +32
- Misses 150 158 +8
- Partials 38 39 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
todo: - configio: decoder API - conversion: decode: fix nil pointer derefence - conversion: separate encode/decode (use dedicated pointerless structure for encode?) - body: to encode or not to encode (alters request) - yaml encode - various refactoring
GregoryAlbouy
force-pushed
the
feat/configio-builder
branch
from
March 28, 2023 21:34
e865353
to
39fb4a6
Compare
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.
master
Description
Changes
Notes