OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package isolatedclient | 5 package isolatedclient |
6 | 6 |
7 import ( | 7 import ( |
8 "errors" | 8 "errors" |
9 "io" | 9 "io" |
10 "io/ioutil" | 10 "io/ioutil" |
11 "net/http" | 11 "net/http" |
12 "strconv" | 12 "strconv" |
13 "strings" | 13 "strings" |
14 | 14 |
15 "github.com/luci/luci-go/client/internal/lhttp" | |
16 "github.com/luci/luci-go/client/internal/retry" | |
17 "github.com/luci/luci-go/client/internal/tracer" | 15 "github.com/luci/luci-go/client/internal/tracer" |
18 "github.com/luci/luci-go/common/isolated" | 16 "github.com/luci/luci-go/common/isolated" |
| 17 "github.com/luci/luci-go/common/lhttp" |
| 18 "github.com/luci/luci-go/common/retry" |
19 ) | 19 ) |
20 | 20 |
21 // IsolateServer is the low-level client interface to interact with an Isolate | 21 // IsolateServer is the low-level client interface to interact with an Isolate |
22 // server. | 22 // server. |
23 type IsolateServer interface { | 23 type IsolateServer interface { |
24 ServerCapabilities() (*isolated.ServerCapabilities, error) | 24 ServerCapabilities() (*isolated.ServerCapabilities, error) |
25 // Contains looks up cache presence on the server of multiple items. | 25 // Contains looks up cache presence on the server of multiple items. |
26 // | 26 // |
27 // The returned list is in the same order as 'items', with entries nil f
or | 27 // The returned list is in the same order as 'items', with entries nil f
or |
28 // items that were present. | 28 // items that were present. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // TODO(maruel): For relatively small file, set request.ContentLength so
the | 164 // TODO(maruel): For relatively small file, set request.ContentLength so
the |
165 // TCP connection can be reused. | 165 // TCP connection can be reused. |
166 resp, err6 := client.Do(request) | 166 resp, err6 := client.Do(request) |
167 if err6 != nil { | 167 if err6 != nil { |
168 return err6 | 168 return err6 |
169 } | 169 } |
170 _, err = io.Copy(ioutil.Discard, resp.Body) | 170 _, err = io.Copy(ioutil.Discard, resp.Body) |
171 _ = resp.Body.Close() | 171 _ = resp.Body.Close() |
172 return | 172 return |
173 } | 173 } |
OLD | NEW |