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

encoder: improve api to make it more generic #337

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

willfindlay
Copy link
Contributor

See commits.

@willfindlay willfindlay requested a review from a team as a code owner August 18, 2022 18:16
Base automatically changed from pr/willfindlay/filters to main August 18, 2022 18:19
Refactor the encoder to use concerete error types rather than fmt.Errorf. This would allow
downstream consumers of the API to more easily match over the error.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay force-pushed the pr/willfindlay/encoder-interface branch from 7dd119c to ac7bdc4 Compare August 18, 2022 18:20
Abstract the GetEncoder logic into a function so that downstream users can plug in their
own encoders as they see fit.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay force-pushed the pr/willfindlay/encoder-interface branch 2 times, most recently from b0aa735 to 9b5b366 Compare August 18, 2022 19:10
@willfindlay willfindlay marked this pull request as draft August 18, 2022 19:10
@willfindlay
Copy link
Contributor Author

Still messing around with this, marking as draft

@willfindlay willfindlay force-pushed the pr/willfindlay/encoder-interface branch 3 times, most recently from 6b94489 to 30196a8 Compare August 18, 2022 19:32
@willfindlay willfindlay marked this pull request as ready for review August 18, 2022 19:35
This change makes it easier to implement alternative encoder types in the future, for
example by embedding the compact encoder inside another encoder struct.

Signed-off-by: William Findlay <[email protected]>
@willfindlay willfindlay force-pushed the pr/willfindlay/encoder-interface branch from 30196a8 to 04b96c5 Compare August 18, 2022 19:36
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

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

let's roll

@michi-covalent michi-covalent merged commit 97eaa21 into main Aug 18, 2022
@michi-covalent michi-covalent deleted the pr/willfindlay/encoder-interface branch August 18, 2022 22:01
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.

2 participants