Add the URLFor optional method to the storagedriver api

We now also have a storagedriver error variable for identifying
api calls that are not implemented by drivers (the URLFor method
is not implemented by either the filesystem or inmemory drivers)
This commit is contained in:
Andrey Kostov 2015-01-07 18:31:38 +02:00
parent fadd5dfcfb
commit a2b294f444
5 changed files with 57 additions and 0 deletions

View file

@ -251,3 +251,9 @@ func (d *Driver) Delete(path string) error {
return err
}
}
// URLFor returns a URL which may be used to retrieve the content stored at the given path.
// May return an UnsupportedMethodErr in certain StorageDriver implementations.
func (d *Driver) URLFor(path string) (string, error) {
return "", storagedriver.ErrUnsupportedMethod
}