Update to new changes in objectstorage-go
This commit is contained in:
Generated
+1
-1
@@ -36,7 +36,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/minio/objectstorage-go",
|
||||
"Rev": "3a8c0c3b348ad327f1e9ec69c3ab07ce327ff796"
|
||||
"Rev": "22b92be8f38740a5cf4cb81d7f3b5b178febfa68"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/shiena/ansicolor",
|
||||
|
||||
+2
-5
@@ -1,5 +1,7 @@
|
||||
# Minimal object storage library in Go
|
||||
|
||||
[](https://travis-ci.org/minio/objectstorage-go)
|
||||
|
||||
## Install
|
||||
|
||||
```go
|
||||
@@ -14,11 +16,6 @@
|
||||
* Community hangout on Gitter [](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
* Ask questions on Quora [](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
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user