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

feat!: support oras.Fetch and oras.FetchBytes #282

Merged
merged 10 commits into from
Sep 1, 2022

Conversation

Wwwsylvia
Copy link
Member

@Wwwsylvia Wwwsylvia commented Aug 25, 2022

Add utility methods for convenient content fetching.

Resolves #272
BREAKING CHANGE: Move content.ErrSizeExceedLimit to errdef.ErrSizeExceedsLimit
Signed-off-by: Sylvia Lei lixlei@microsoft.com

Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2022

Codecov Report

Merging #282 (f3a5807) into main (59befb3) will increase coverage by 0.10%.
The diff coverage is 75.22%.

@@            Coverage Diff             @@
##             main     #282      +/-   ##
==========================================
+ Coverage   70.87%   70.97%   +0.10%     
==========================================
  Files          37       37              
  Lines        3368     3421      +53     
==========================================
+ Hits         2387     2428      +41     
- Misses        734      743       +9     
- Partials      247      250       +3     
Impacted Files Coverage Δ
content/limitedstorage.go 0.00% <0.00%> (ø)
extendedcopy.go 68.42% <ø> (ø)
registry/remote/repository.go 65.94% <ø> (ø)
internal/platform/platform.go 81.42% <71.73%> (-18.58%) ⬇️
content.go 71.13% <83.33%> (+14.88%) ⬆️
copy.go 57.89% <100.00%> (-2.89%) ⬇️
registry/remote/utils.go 76.92% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Wwwsylvia Wwwsylvia marked this pull request as draft August 26, 2022 08:01
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
@Wwwsylvia Wwwsylvia changed the title feat: support FetchManifest and FetchBlob feat: support FetchContent Aug 30, 2022
@Wwwsylvia Wwwsylvia changed the title feat: support FetchContent feat: support oras.FetchContent Aug 30, 2022
@Wwwsylvia Wwwsylvia marked this pull request as ready for review August 30, 2022 11:51
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
}

// FetchBytes fetches the content bytes identified by the reference.
func FetchBytes(ctx context.Context, target ReadOnlyTarget, reference string, opts FetchBytesOptions) (ocispec.Descriptor, []byte, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Any naming suggestions are welcomed!

@Wwwsylvia Wwwsylvia changed the title feat: support oras.FetchContent feat!: support oras.FetchContent Aug 31, 2022
@Wwwsylvia Wwwsylvia requested a review from shizhMSFT August 31, 2022 09:34
@Wwwsylvia Wwwsylvia changed the title feat!: support oras.FetchContent feat!: support oras.Fetch and oras.FetchBytes Aug 31, 2022
@Wwwsylvia Wwwsylvia changed the title feat!: support oras.Fetch and oras.FetchBytes feat!: support oras.Fetch and oras.FetchBytes Aug 31, 2022
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Signed-off-by: Sylvia Lei <lixlei@microsoft.com>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

@Wwwsylvia Wwwsylvia merged commit ccd61e9 into oras-project:main Sep 1, 2022
@Wwwsylvia Wwwsylvia deleted the getcontent branch September 1, 2022 11:37
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.

Utility method for getting content
4 participants