Documentation ¶
Index ¶
- func MarshalToRequest(req *http.Request, obj interface{}) error
- type Client
- func (c *Client) Close() error
- func (c *Client) ConcurrentTransfers() int
- func (c *Client) Context() lfshttp.Context
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) DoAPIRequestWithAuth(remote string, req *http.Request) (*http.Response, error)
- func (c *Client) DoWithAuth(remote string, access creds.Access, req *http.Request) (*http.Response, error)
- func (c *Client) DoWithAuthNoRetry(remote string, access creds.Access, req *http.Request) (*http.Response, error)
- func (c *Client) GitEnv() config.Environment
- func (c *Client) LogHTTPStats(w io.WriteCloser)
- func (c *Client) LogRequest(r *http.Request, reqKey string) *http.Request
- func (c *Client) NewRequest(method string, e lfshttp.Endpoint, suffix string, body interface{}) (*http.Request, error)
- func (c *Client) OSEnv() config.Environment
- func (c *Client) SSHTransfer(operation, remote string) *ssh.SSHTransfer
- type EndpointFinder
- type ReadSeekCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalToRequest ¶
Types ¶
type Client ¶
type Client struct { Endpoints EndpointFinder Credentials creds.CredentialHelper // contains filtered or unexported fields }
func (*Client) ConcurrentTransfers ¶
func (*Client) Do ¶
Do sends an HTTP request to get an HTTP response. It wraps net/http, adding extra headers, redirection handling, and error reporting.
func (*Client) DoAPIRequestWithAuth ¶
DoAPIRequestWithAuth sends an HTTP request to get an HTTP response similarly to DoWithAuth, but using the LFS API endpoint for the provided remote and operation to determine the access mode.
func (*Client) DoWithAuth ¶
func (c *Client) DoWithAuth(remote string, access creds.Access, req *http.Request) (*http.Response, error)
DoWithAuth sends an HTTP request to get an HTTP response. It attempts to add authentication from netrc or git's credential helpers if necessary, supporting basic authentication.
func (*Client) DoWithAuthNoRetry ¶
func (c *Client) DoWithAuthNoRetry(remote string, access creds.Access, req *http.Request) (*http.Response, error)
DoWithAuthNoRetry sends an HTTP request to get an HTTP response. It works in the same way as DoWithAuth, but will not retry the request if it fails with an authorization error.
func (*Client) GitEnv ¶
func (c *Client) GitEnv() config.Environment
func (*Client) LogHTTPStats ¶
func (c *Client) LogHTTPStats(w io.WriteCloser)
func (*Client) LogRequest ¶
func (*Client) NewRequest ¶
func (*Client) OSEnv ¶
func (c *Client) OSEnv() config.Environment
func (*Client) SSHTransfer ¶
func (c *Client) SSHTransfer(operation, remote string) *ssh.SSHTransfer
SSHTransfer returns either an suitable transfer object or nil if the server is not using an SSH remote or the git-lfs-transfer style of SSH remote.
type EndpointFinder ¶
type EndpointFinder interface { NewEndpointFromCloneURL(operation, rawurl string) lfshttp.Endpoint NewEndpoint(operation, rawurl string) lfshttp.Endpoint Endpoint(operation, remote string) lfshttp.Endpoint RemoteEndpoint(operation, remote string) lfshttp.Endpoint GitRemoteURL(remote string, forpush bool) string AccessFor(rawurl string) creds.Access SetAccess(access creds.Access) GitProtocol() string }
func NewEndpointFinder ¶
func NewEndpointFinder(ctx lfshttp.Context) EndpointFinder
type ReadSeekCloser ¶
type ReadSeekCloser interface { io.Seeker io.ReadCloser }
func NewByteBody ¶
func NewByteBody(by []byte) ReadSeekCloser