Skip to content

Commit 95a7b9e

Browse files
authored
Merge pull request #46 from RachelTucker/redesign-client-network
GOSDK-8: Redesign client network
2 parents 80b9faf + f095daf commit 95a7b9e

File tree

808 files changed

+11460
-19620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

808 files changed

+11460
-19620
lines changed

src/ds3/ds3Client.go

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@ import (
55
"net/url"
66
)
77

8+
const (
9+
HTTP_VERB_GET = "GET"
10+
HTTP_VERB_PUT = "PUT"
11+
HTTP_VERB_POST = "POST"
12+
HTTP_VERB_DELETE = "DELETE"
13+
HTTP_VERB_HEAD = "HEAD"
14+
HTTP_VERB_PATCH = "PATCH"
15+
)
16+
817
type Client struct {
9-
netLayer networking.Network
10-
clientPolicy *ClientPolicy
18+
sendNetwork networking.Network
19+
clientPolicy *ClientPolicy
20+
connectionInfo *networking.ConnectionInfo
1121
}
1222

1323
type ClientBuilder struct {
@@ -26,9 +36,9 @@ const DEFAULT_MAX_REDIRECTS = 5
2636
func NewClientBuilder(endpoint *url.URL, creds *networking.Credentials) *ClientBuilder {
2737
return &ClientBuilder{
2838
&networking.ConnectionInfo{
29-
Endpoint: endpoint,
30-
Creds: creds,
31-
Proxy: nil},
39+
Endpoint: endpoint,
40+
Credentials: creds,
41+
Proxy: nil},
3242
&ClientPolicy{
3343
maxRetries: DEFAULT_MAX_RETRIES,
3444
maxRedirect: DEFAULT_MAX_REDIRECTS}}
@@ -51,8 +61,8 @@ func (clientBuilder *ClientBuilder) WithNetworkRetryCount(count int) *ClientBuil
5161

5262
func (clientBuilder *ClientBuilder) BuildClient() *Client {
5363
return &Client{
54-
networking.NewHttpNetwork(clientBuilder.connectionInfo),
55-
clientBuilder.clientPolicy,
64+
sendNetwork: networking.NewSendNetwork(clientBuilder.connectionInfo),
65+
clientPolicy: clientBuilder.clientPolicy,
66+
connectionInfo: clientBuilder.connectionInfo,
5667
}
5768
}
58-

src/ds3/ds3Client_test.go

Lines changed: 56 additions & 59 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)