Add initial S3 support

* Requires a patched goamz to enable metadata reading and writing
  * Still todo: updating metadata
  * EU region not working yet
This commit is contained in:
Nick Craig-Wood
2013-01-08 18:53:35 +00:00
parent f7197c30d7
commit b9e468ebbd
5 changed files with 378 additions and 3 deletions

View File

@ -47,7 +47,7 @@ func (f *FsSwift) String() string {
}
// Pattern to match a swift url
var swiftMatch = regexp.MustCompile(`^([^/:]+):(.*)$`)
var swiftMatch = regexp.MustCompile(`^swift://([^/]+)(.*)$`)
// parseParse parses a swift 'url'
func parsePath(path string) (container, directory string, err error) {
@ -294,7 +294,7 @@ func (fs *FsObjectSwift) Storable() bool {
// Open an object for read
func (fs *FsObjectSwift) Open() (in io.ReadCloser, err error) {
in, _, err = fs.swift.c.ObjectOpen(fs.swift.container, fs.info.Name, true, nil)
in, _, err = fs.swift.c.ObjectOpen(fs.swift.container, fs.remote, true, nil)
return
}