~andychilton/goamz/aws-fix-for-r60

« back to all changes in this revision

Viewing changes to s3.go

  • Committer: Gustavo Niemeyer
  • Date: 2011-02-01 12:45:59 UTC
  • Revision ID: gustavo@niemeyer.net-20110201124559-mkuol9axpel46fhi
Expanding names again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
type S3ACL string
41
41
 
42
42
const (
43
 
    S3Private = S3ACL("private")
44
 
    S3PublicRead = S3ACL("public-read")
45
 
    S3PublicReadWrite = S3ACL("public-read-write")
 
43
    S3Private           = S3ACL("private")
 
44
    S3PublicRead        = S3ACL("public-read")
 
45
    S3PublicReadWrite   = S3ACL("public-read-write")
46
46
    S3AuthenticatedRead = S3ACL("authenticated-read")
47
 
    S3BucketOwnerRead = S3ACL("bucket-owner-read")
48
 
    S3BucketOwnerFull = S3ACL("bucket-owner-full-control")
 
47
    S3BucketOwnerRead   = S3ACL("bucket-owner-read")
 
48
    S3BucketOwnerFull   = S3ACL("bucket-owner-full-control")
49
49
)
50
50
 
51
51
// PutBucket creates a new bucket.
93
93
func (b *S3Bucket) Put(path string, data []byte, contType string, perm S3ACL) os.Error {
94
94
    headers := map[string]string{
95
95
        "Content-Length": strconv.Itoa(len(data)),
96
 
        "Content-Type": contType,
97
 
        "x-amz-acl": string(perm),
 
96
        "Content-Type":   contType,
 
97
        "x-amz-acl":      string(perm),
98
98
    }
99
99
    body := strings.NewReader(string(data))
100
100
    _, err := b.S3.query("PUT", b.Name, path, nil, headers, body, nil)
159
159
    Code       string // EC2 error code ("UnsupportedOperation", ...)
160
160
    Message    string // The human-oriented error message
161
161
    BucketName string
162
 
    RequestId string
163
 
    HostId string
 
162
    RequestId  string
 
163
    HostId     string
164
164
}
165
165
 
166
166
func (e *S3Error) String() string {