2014-12-05 22:34:22 +00:00
|
|
|
// +build ignore
|
|
|
|
|
2014-10-24 23:37:25 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"os"
|
|
|
|
|
2014-12-02 02:25:10 +00:00
|
|
|
"github.com/Sirupsen/logrus"
|
|
|
|
|
2014-12-24 00:01:38 +00:00
|
|
|
"github.com/docker/distribution/storagedriver/ipc"
|
|
|
|
"github.com/docker/distribution/storagedriver/s3"
|
2014-10-24 23:37:25 +00:00
|
|
|
)
|
|
|
|
|
2014-10-29 01:15:40 +00:00
|
|
|
// An out-of-process S3 driver, intended to be run by ipc.NewDriverClient
|
2014-10-24 23:37:25 +00:00
|
|
|
func main() {
|
|
|
|
parametersBytes := []byte(os.Args[1])
|
2014-10-29 01:15:40 +00:00
|
|
|
var parameters map[string]string
|
2014-10-24 23:37:25 +00:00
|
|
|
err := json.Unmarshal(parametersBytes, ¶meters)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2014-10-29 01:15:40 +00:00
|
|
|
driver, err := s3.FromParameters(parameters)
|
2014-10-24 23:37:25 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2014-12-02 02:25:10 +00:00
|
|
|
if err := ipc.StorageDriverServer(driver); err != nil {
|
|
|
|
logrus.Fatalln(err)
|
|
|
|
}
|
2014-10-24 23:37:25 +00:00
|
|
|
}
|