1
0
mirror of https://github.com/minio/mc.git synced 2025-11-13 12:22:45 +03:00

Full cleanup of s3 client for mc

This commit is contained in:
Harshavardhana
2015-05-01 15:52:08 -07:00
parent 28315e7492
commit 78a78c072a
23 changed files with 1008 additions and 875 deletions

View File

@@ -0,0 +1,68 @@
package s3
import (
"net/http"
"net/url"
"time"
"github.com/awslabs/aws-sdk-go/service/s3"
)
//
type content struct {
Key string
LastModified time.Time
ETag string
Size int64
}
// prefix
type prefix struct {
Prefix string
}
type listBucketResults struct {
Contents []*content
IsTruncated bool
MaxKeys int
Name string // bucket name
Marker string
Delimiter string
Prefix string
CommonPrefixes []*prefix
}
// Meta holds Amazon S3 client credentials and flags.
type Meta struct {
*Config
*s3.S3
Transport http.RoundTripper // or nil for the default behavior
}
// Config - see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html
type Config struct {
AccessKeyID string
SecretAccessKey string
HostURL string
UserAgent string
Debug bool
// Used for SSL transport layer
CertPEM string
KeyPEM string
}
// TLSConfig - TLS cert and key configuration
type TLSConfig struct {
CertPEMBlock []byte
KeyPEMBlock []byte
}
type s3Client struct {
*Meta
// Supports URL in following formats
// - http://<ipaddress>/<bucketname>/<object>
// - http://<bucketname>.<domain>/<object>
*url.URL
}