|
@ -28,7 +28,7 @@ type S3ApiServerOption struct { |
|
|
GrpcDialOption grpc.DialOption |
|
|
GrpcDialOption grpc.DialOption |
|
|
AllowEmptyFolder bool |
|
|
AllowEmptyFolder bool |
|
|
AllowDeleteBucketNotEmpty bool |
|
|
AllowDeleteBucketNotEmpty bool |
|
|
LocalFilerSocket *string |
|
|
|
|
|
|
|
|
LocalFilerSocket string |
|
|
DataCenter string |
|
|
DataCenter string |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer |
|
|
filerGuard: security.NewGuard([]string{}, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec), |
|
|
filerGuard: security.NewGuard([]string{}, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec), |
|
|
cb: NewCircuitBreaker(option), |
|
|
cb: NewCircuitBreaker(option), |
|
|
} |
|
|
} |
|
|
if option.LocalFilerSocket == nil || *option.LocalFilerSocket == "" { |
|
|
|
|
|
|
|
|
if option.LocalFilerSocket == "" { |
|
|
s3ApiServer.client = &http.Client{Transport: &http.Transport{ |
|
|
s3ApiServer.client = &http.Client{Transport: &http.Transport{ |
|
|
MaxIdleConns: 1024, |
|
|
MaxIdleConns: 1024, |
|
|
MaxIdleConnsPerHost: 1024, |
|
|
MaxIdleConnsPerHost: 1024, |
|
@ -68,7 +68,7 @@ func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer |
|
|
s3ApiServer.client = &http.Client{ |
|
|
s3ApiServer.client = &http.Client{ |
|
|
Transport: &http.Transport{ |
|
|
Transport: &http.Transport{ |
|
|
DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { |
|
|
DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { |
|
|
return net.Dial("unix", *option.LocalFilerSocket) |
|
|
|
|
|
|
|
|
return net.Dial("unix", option.LocalFilerSocket) |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|