-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push/Pull return the descriptor of the associated tag (#70)
return ref manifest
- Loading branch information
Showing
10 changed files
with
167 additions
and
43 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package oras | ||
|
||
type pullOpts struct { | ||
allowedMediaTypes []string | ||
} | ||
|
||
// PullOpt allows callers to set options on the oras pull | ||
type PullOpt func(o *pullOpts) error | ||
|
||
func pullOptsDefaults() *pullOpts { | ||
return &pullOpts{} | ||
} | ||
|
||
// WithAllowedMediaType sets the allowed media types | ||
func WithAllowedMediaType(allowedMediaTypes ...string) PullOpt { | ||
return func(o *pullOpts) error { | ||
o.allowedMediaTypes = append(o.allowedMediaTypes, allowedMediaTypes...) | ||
return nil | ||
} | ||
} | ||
|
||
// WithAllowedMediaTypes sets the allowed media types | ||
func WithAllowedMediaTypes(allowedMediaTypes []string) PullOpt { | ||
return func(o *pullOpts) error { | ||
o.allowedMediaTypes = append(o.allowedMediaTypes, allowedMediaTypes...) | ||
return nil | ||
} | ||
} |
Oops, something went wrong.