mirror of
https://github.com/distribution/distribution.git
synced 2025-09-07 18:00:55 +00:00
Introduce dynamic plugins
go1.8 Plugin package brings a mechanism for dynamyc loading. StorageDriver or AccessController can be compiled as plugin and can be loaded at runtime. Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
This commit is contained in:
@@ -198,5 +198,14 @@ func GetAccessController(name string, options map[string]interface{}) (AccessCon
|
||||
return initFunc(options)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("no access controller registered with name: %s", name)
|
||||
return nil, InvalidAccessControllerError{name}
|
||||
}
|
||||
|
||||
// InvalidAccessControllerError records an attempt to construct an unregistered storage driver
|
||||
type InvalidAccessControllerError struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
func (err InvalidAccessControllerError) Error() string {
|
||||
return fmt.Sprintf("no access controller registered with name: %s", err.Name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user