File: client.go

package info (click to toggle)
git-lfs 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,808 kB
  • sloc: sh: 21,256; makefile: 507; ruby: 417
file content (55 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package lfsapi

import (
	"io"
	"net/http"

	"github.com/git-lfs/git-lfs/v3/config"
	"github.com/git-lfs/git-lfs/v3/creds"
	"github.com/git-lfs/git-lfs/v3/lfshttp"
)

func (c *Client) NewRequest(method string, e lfshttp.Endpoint, suffix string, body interface{}) (*http.Request, error) {
	return c.client.NewRequest(method, e, suffix, body)
}

// Do sends an HTTP request to get an HTTP response. It wraps net/http, adding
// extra headers, redirection handling, and error reporting.
func (c *Client) Do(req *http.Request) (*http.Response, error) {
	return c.client.Do(req)
}

// do performs an *http.Request respecting redirects, and handles the response
// as defined in c.handleResponse. Notably, it does not alter the headers for
// the request argument in any way.
func (c *Client) do(req *http.Request, remote string, via []*http.Request) (*http.Response, error) {
	return c.client.Do(req)
}

func (c *Client) doWithAccess(req *http.Request, remote string, via []*http.Request, mode creds.AccessMode) (*http.Response, error) {
	return c.client.DoWithAccess(req, mode)
}

func (c *Client) LogRequest(r *http.Request, reqKey string) *http.Request {
	return c.client.LogRequest(r, reqKey)
}

func (c *Client) GitEnv() config.Environment {
	return c.client.GitEnv()
}

func (c *Client) OSEnv() config.Environment {
	return c.client.OSEnv()
}

func (c *Client) ConcurrentTransfers() int {
	return c.client.ConcurrentTransfers
}

func (c *Client) LogHTTPStats(w io.WriteCloser) {
	c.client.LogHTTPStats(w)
}

func (c *Client) Close() error {
	return c.client.Close()
}