Update to new changes in objectstorage-go

This commit is contained in:
Harshavardhana
2015-05-16 17:12:36 -07:00
parent a2b8f053b0
commit ab6fe3e95a
4 changed files with 9 additions and 13 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
},
{
"ImportPath": "github.com/minio/objectstorage-go",
"Rev": "3a8c0c3b348ad327f1e9ec69c3ab07ce327ff796"
"Rev": "22b92be8f38740a5cf4cb81d7f3b5b178febfa68"
},
{
"ImportPath": "github.com/shiena/ansicolor",
+2 -5
View File
@@ -1,5 +1,7 @@
# Minimal object storage library in Go
[![Build Status](https://travis-ci.org/minio/objectstorage-go.svg)](https://travis-ci.org/minio/objectstorage-go)
## Install
```go
@@ -14,11 +16,6 @@
* Community hangout on Gitter [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Ask questions on Quora [![Quora](http://upload.wikimedia.org/wikipedia/commons/thumb/5/57/Quora_logo.svg/55px-Quora_logo.svg.png)](http://www.quora.com/Minio)
## Roadmap
- Add v4 signature support
- Add s3 multi region support
## Contribute
[Contribute to minimal object storage library](./CONTRIBUTING.md)
+5 -6
View File
@@ -131,7 +131,8 @@ type Config struct {
// MustGetEndpoint makes sure that a valid endpoint is provided all the time, even with false regions it will fall
// back to default, for no regions specified it chooses to default to "milkyway" and use endpoint as is
func (c *Config) MustGetEndpoint() string {
if strings.TrimSpace(c.Endpoint) != "" && strings.TrimSpace(c.Region) == "" {
switch {
case strings.TrimSpace(c.Endpoint) != "" && strings.TrimSpace(c.Region) == "":
if strings.Contains(strings.TrimSpace(c.Endpoint), "s3.amazonaws.com") {
c.Region = "us-east-1"
return getEndpoint(c.Region)
@@ -139,16 +140,14 @@ func (c *Config) MustGetEndpoint() string {
// for custom domains, there are no regions default to 'milkyway'
c.Region = "milkyway"
return c.Endpoint
}
// if valid region provided override user provided endpoint
if strings.TrimSpace(c.Region) != "" {
case strings.TrimSpace(c.Region) != "":
if endpoint := getEndpoint(strings.TrimSpace(c.Region)); endpoint != "" {
c.Endpoint = endpoint
return c.Endpoint
}
// fall back if region is set and not found, go through US-standard
c.Region = "us-east-1"
return getEndpoint(c.Region)
// fall back to custom Endpoint, if no valid region can be found
return c.Endpoint
}
// if not endpoint or region sepcified default to us-east-1
c.Region = "us-east-1"
+1 -1
View File
@@ -81,7 +81,7 @@ func New(config *Config) client.Client {
var transport http.RoundTripper
switch {
case config.Debug == true:
transport = GetNewTraceTransport(nil, GetNewTraceTransport(NewTrace(true, true, nil), http.DefaultTransport))
transport = GetNewTraceTransport(nil, GetNewTraceTransport(NewTrace(false, true, nil), http.DefaultTransport))
default:
transport = http.DefaultTransport
}