Add Openstack Swift storage driver
Signed-off-by: Sylvain Baubeau <sbaubeau@redhat.com>
This commit is contained in:
parent
5ee441cdc7
commit
ea7c53df08
8 changed files with 828 additions and 0 deletions
32
cmd/registry-storagedriver-swift/main.go
Normal file
32
cmd/registry-storagedriver-swift/main.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
|
||||
"github.com/docker/distribution/registry/storage/driver/ipc"
|
||||
"github.com/docker/distribution/registry/storage/driver/swift"
|
||||
)
|
||||
|
||||
// An out-of-process Swift driver, intended to be run by ipc.NewDriverClient
|
||||
func main() {
|
||||
parametersBytes := []byte(os.Args[1])
|
||||
var parameters map[string]string
|
||||
err := json.Unmarshal(parametersBytes, ¶meters)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
driver, err := swift.FromParameters(parameters)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := ipc.StorageDriverServer(driver); err != nil {
|
||||
logrus.Fatalln(err)
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ import (
|
|||
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
|
||||
_ "github.com/docker/distribution/registry/storage/driver/middleware/cloudfront"
|
||||
_ "github.com/docker/distribution/registry/storage/driver/s3"
|
||||
_ "github.com/docker/distribution/registry/storage/driver/swift"
|
||||
"github.com/docker/distribution/version"
|
||||
gorhandlers "github.com/gorilla/handlers"
|
||||
"github.com/yvasiyarov/gorelic"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue