storage: set storage service endpoint if set in options
@@ -82,7 +82,7 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error
option.WithUserAgent(userAgent),
}
opts = append(o, opts...)
- hc, _, err := transport.NewHTTPClient(ctx, opts...)
+ hc, ep, err := transport.NewHTTPClient(ctx, opts...)
if err != nil {
return nil, fmt.Errorf("dialing: %v", err)
}
@@ -90,6 +90,9 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error
if err != nil {
return nil, fmt.Errorf("storage client: %v", err)
}
+ if ep != "" {
+ rawService.BasePath = ep
+ }
return &Client{
hc: hc,
raw: rawService,
