Rename top level registry interface to namespace
Registry is intended to be used as a repository service than an abstract collection of repositories. Namespace better describes a collection of repositories retrievable by name. The registry service serves any repository in the global scope. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
250e61e2a1
commit
e83e37618f
4 changed files with 12 additions and 6 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
// InitFunc is the type of a RegistryMiddleware factory function and is
|
||||
// used to register the constructor for different RegistryMiddleware backends.
|
||||
type InitFunc func(registry distribution.Registry, options map[string]interface{}) (distribution.Registry, error)
|
||||
type InitFunc func(registry distribution.Namespace, options map[string]interface{}) (distribution.Namespace, error)
|
||||
|
||||
var middlewares map[string]InitFunc
|
||||
|
||||
|
@ -28,7 +28,7 @@ func Register(name string, initFunc InitFunc) error {
|
|||
}
|
||||
|
||||
// Get constructs a RegistryMiddleware with the given options using the named backend.
|
||||
func Get(name string, options map[string]interface{}, registry distribution.Registry) (distribution.Registry, error) {
|
||||
func Get(name string, options map[string]interface{}, registry distribution.Namespace) (distribution.Namespace, error) {
|
||||
if middlewares != nil {
|
||||
if initFunc, exists := middlewares[name]; exists {
|
||||
return initFunc(registry, options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue