ncw/swift — pull request #15 by groks (2013-10-13 19:09:58+00:00)
Title: Export Connection.Transport for use on Appengine

Some environments, such as Google Appengine, have restrictions on sockets.
An http transport can be used with Connection to interface to the custom
backend:

import (
"appengine/urlfetch"
"fmt"
"github.com/ncw/swift"
)

func handler(w http.ResponseWriter, r *http.Request) {
ctx := appengine.NewContext(r)
c := swift.Connection{
UserName: "user",
ApiKey: "key",
AuthUrl: "auth_url",
Transport: urlfetch.Transport{Context: ctx},
}
err := c.Authenticate()
if err != nil {
panic(err)
}
fmt.Fprintf(w, "Authenticate OK")
}

Fixes #5
Original fix by @vmihailenko