lfsapi

package
v2.13.1-0...-077e46b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: BSD-3-Clause, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalToRequest

func MarshalToRequest(req *http.Request, obj interface{}) error

Types

type Client

type Client struct {
	Endpoints   EndpointFinder
	Credentials creds.CredentialHelper
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx lfshttp.Context) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) ConcurrentTransfers

func (c *Client) ConcurrentTransfers() int

func (*Client) Context

func (c *Client) Context() lfshttp.Context

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

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

func (c *Client) DoAPIRequestWithAuth(remote string, req *http.Request) (*http.Response, error)

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 (c *Client) LogRequest(r *http.Request, reqKey string) *http.Request

func (*Client) NewRequest

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL