Skip to content

Commit 33c19cb

Browse files
peterjanChrisSchinnerl
authored andcommitted
util: rename method
1 parent 0d0321f commit 33c19cb

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

bus/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ func (c *Client) do(req *http.Request, resp interface{}) error {
3232
if c.c.Password != "" {
3333
req.SetBasicAuth("", c.c.Password)
3434
}
35-
_, _, err := utils.SendRequest(req, &resp)
35+
_, _, err := utils.DoRequest(req, &resp)
3636
return err
3737
}

bus/client/metrics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (c *Client) PruneMetrics(ctx context.Context, metric string, cutoff time.Ti
129129
panic(err)
130130
}
131131
req.SetBasicAuth("", c.c.WithContext(ctx).Password)
132-
_, _, err = utils.SendRequest(req, nil)
132+
_, _, err = utils.DoRequest(req, nil)
133133
return err
134134
}
135135

@@ -150,7 +150,7 @@ func (c *Client) recordMetric(ctx context.Context, key string, d interface{}) er
150150
panic(err)
151151
}
152152
req.SetBasicAuth("", c.c.WithContext(ctx).Password)
153-
_, _, err = utils.SendRequest(req, nil)
153+
_, _, err = utils.DoRequest(req, nil)
154154
return err
155155
}
156156

@@ -167,6 +167,6 @@ func (c *Client) metric(ctx context.Context, key string, values url.Values, res
167167
panic(err)
168168
}
169169
req.SetBasicAuth("", c.c.WithContext(ctx).Password)
170-
_, _, err = utils.SendRequest(req, &res)
170+
_, _, err = utils.DoRequest(req, &res)
171171
return err
172172
}

bus/client/slabs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (c *Client) AddPartialSlab(ctx context.Context, data []byte, minShards, tot
3434
}
3535
req.SetBasicAuth("", c.c.WithContext(ctx).Password)
3636
var apsr api.AddPartialSlabResponse
37-
_, _, err = utils.SendRequest(req, &apsr)
37+
_, _, err = utils.DoRequest(req, &apsr)
3838
if err != nil {
3939
return nil, false, err
4040
}

internal/bus/forex.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ func (f *client) SiacoinExchangeRate(ctx context.Context, currency string) (rate
2626
}
2727
req.Header.Set("Accept", "application/json")
2828

29-
_, _, err = utils.SendRequest(req, &rate)
29+
_, _, err = utils.DoRequest(req, &rate)
3030
return
3131
}

internal/utils/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func OpenBrowser(url string) error {
8383
}
8484
}
8585

86-
func SendRequest(req *http.Request, resp interface{}) (header http.Header, statusCode int, err error) {
86+
func DoRequest(req *http.Request, resp interface{}) (header http.Header, statusCode int, err error) {
8787
r, err := http.DefaultClient.Do(req)
8888
if err != nil {
8989
return nil, 0, err

internal/worker/events_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,6 @@ func sendEvent(url string, event webhooks.Event) error {
203203
return err
204204
}
205205

206-
_, _, err = utils.SendRequest(req, nil)
206+
_, _, err = utils.DoRequest(req, nil)
207207
return err
208208
}

webhooks/webhooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,6 @@ func sendEvent(ctx context.Context, url string, headers map[string]string, actio
269269
req.Header.Set(k, v)
270270
}
271271

272-
_, _, err = utils.SendRequest(req, nil)
272+
_, _, err = utils.DoRequest(req, nil)
273273
return err
274274
}

worker/client/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (c *Client) HeadObject(ctx context.Context, bucket, path string, opts api.H
109109
req.SetBasicAuth("", c.c.WithContext(ctx).Password)
110110
opts.ApplyHeaders(req.Header)
111111

112-
headers, statusCode, err := utils.SendRequest(req, nil)
112+
headers, statusCode, err := utils.DoRequest(req, nil)
113113
if err != nil && statusCode == http.StatusNotFound {
114114
return nil, api.ErrObjectNotFound
115115
} else if err != nil {
@@ -219,7 +219,7 @@ func (c *Client) UploadMultipartUploadPart(ctx context.Context, r io.Reader, buc
219219
} else if req.ContentLength, err = sizeFromSeeker(r); err != nil {
220220
return nil, fmt.Errorf("failed to get content length from seeker: %w", err)
221221
}
222-
header, _, err := utils.SendRequest(req, nil)
222+
header, _, err := utils.DoRequest(req, nil)
223223
if err != nil {
224224
return nil, err
225225
}
@@ -250,7 +250,7 @@ func (c *Client) UploadObject(ctx context.Context, r io.Reader, bucket, path str
250250
} else if req.ContentLength, err = sizeFromSeeker(r); err != nil {
251251
return nil, fmt.Errorf("failed to get content length from seeker: %w", err)
252252
}
253-
header, _, err := utils.SendRequest(req, nil)
253+
header, _, err := utils.DoRequest(req, nil)
254254
if err != nil {
255255
return nil, err
256256
}

0 commit comments

Comments
 (0)