Skip to content

compression: introduce compression.Type interface#3136

Merged
tonistiigi merged 3 commits into
moby:masterfrom
imeoer:compression-type-interface
Oct 26, 2022
Merged

compression: introduce compression.Type interface#3136
tonistiigi merged 3 commits into
moby:masterfrom
imeoer:compression-type-interface

Conversation

@imeoer
Copy link
Copy Markdown
Contributor

@imeoer imeoer commented Sep 29, 2022

Introduce a new compression.Type interface, which needs
to be implemented for each compression type, by that we can
reduce the number of switch case statements and ensure that
we don't miss the handle of any compression types, and also
make more easily for supporting new compression types.

This is a commit for code improvement, so no logical changes.

A successful test can be found here.

@imeoer imeoer force-pushed the compression-type-interface branch from 67812dc to 4965e48 Compare September 29, 2022 07:28
@imeoer imeoer force-pushed the compression-type-interface branch 2 times, most recently from 73f82dd to 3c82a8b Compare September 30, 2022 13:56
@imeoer
Copy link
Copy Markdown
Contributor Author

imeoer commented Oct 7, 2022

cc @ktock @AkihiroSuda @tonistiigi

Comment thread util/compression/compression.go
Comment thread cache/remotecache/export.go Outdated
Comment thread util/compression/compression.go Outdated
Comment thread util/compression/compression.go Outdated
@imeoer imeoer force-pushed the compression-type-interface branch 4 times, most recently from 8961a30 to 9ce0c53 Compare October 14, 2022 09:12
@imeoer
Copy link
Copy Markdown
Contributor Author

imeoer commented Oct 18, 2022

@AkihiroSuda @ktock Ping~ Please help to keep looking.

@imeoer imeoer force-pushed the compression-type-interface branch from 9ce0c53 to c1e0397 Compare October 18, 2022 12:45
@AkihiroSuda AkihiroSuda requested a review from ktock October 18, 2022 14:39
@hsiangkao
Copy link
Copy Markdown

Thanks a lot for the review! @AkihiroSuda

Comment thread util/compression/compression.go Outdated
Introduce a new compression.Type interface, which needs
to be implemented for each compression type, by that we can
reduce the number of switch case statements and ensure that
we don't miss the handle of any compression types, and also
make more easily for supporting new compression types.

This is a commit for code improvement, so no logical changes.

Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
Make the field `compression` private in case it is initialized
with nil compression.Type.

Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
@imeoer imeoer force-pushed the compression-type-interface branch from c1e0397 to 1cfbf10 Compare October 19, 2022 08:46
@imeoer imeoer changed the title compression: introduce compression.Compression interface compression: introduce compression.Type interface Oct 19, 2022
@hsiangkao
Copy link
Copy Markdown

Could someone help merge this commit so we could proceed the main PR? Thanks a lot!

@imeoer
Copy link
Copy Markdown
Contributor Author

imeoer commented Oct 24, 2022

@tonistiigi Ping~, please help to take a final look, thanks!

@tonistiigi tonistiigi merged commit 99f3663 into moby:master Oct 26, 2022
@imeoer
Copy link
Copy Markdown
Contributor Author

imeoer commented Oct 26, 2022

Thanks for all!

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.

6 participants