Allow clients to request specific manifest media types
The current registry/client sends the registered manifest types in random order. Allow clients to request a single specific manifest type or a preferred order as per the HTTP spec. Signed-off-by: Clayton Coleman <ccoleman@redhat.com>
This commit is contained in:
parent
bb49a1685d
commit
3c5f85abd1
3 changed files with 88 additions and 4 deletions
15
registry.go
15
registry.go
|
@ -73,6 +73,21 @@ func (o WithTagOption) Apply(m ManifestService) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// WithManifestMediaTypes lists the media types the client wishes
|
||||
// the server to provide.
|
||||
func WithManifestMediaTypes(mediaTypes []string) ManifestServiceOption {
|
||||
return WithManifestMediaTypesOption{mediaTypes}
|
||||
}
|
||||
|
||||
// WithManifestMediaTypesOption holds a list of accepted media types
|
||||
type WithManifestMediaTypesOption struct{ MediaTypes []string }
|
||||
|
||||
// Apply conforms to the ManifestServiceOption interface
|
||||
func (o WithManifestMediaTypesOption) Apply(m ManifestService) error {
|
||||
// no implementation
|
||||
return nil
|
||||
}
|
||||
|
||||
// Repository is a named collection of manifests and layers.
|
||||
type Repository interface {
|
||||
// Named returns the name of the repository.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue