Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeJSON(res *http.Response, obj interface{}) error
- func IsDecodeTypeError(err error) bool
- func IsHTTP(err error) (*http.Response, bool)
- func MarshalToRequest(req *http.Request, obj interface{}) error
- func NewStatusCodeError(res *http.Response) error
- func Retries(req *http.Request) (int, bool)
- func WithRetries(req *http.Request, n int) *http.Request
- type Client
- func (c *Client) Close() error
- func (c *Client) CurrentUser() (string, string)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) DoWithAccess(req *http.Request, mode creds.AccessMode) (*http.Response, error)
- func (c *Client) DoWithRedirect(cli *http.Client, req *http.Request, remote string, via []*http.Request) (*http.Request, *http.Response, error)
- func (c *Client) ExtraHeadersFor(req *http.Request) http.Header
- func (c *Client) GitEnv() config.Environment
- func (c *Client) HttpClient(u *url.URL, access creds.AccessMode) (*http.Client, error)
- func (c *Client) LogHTTPStats(w io.WriteCloser)
- func (c *Client) LogRequest(r *http.Request, reqKey string) *http.Request
- func (c *Client) LogResponse(key string, res *http.Response)
- func (c *Client) LogStats(out io.Writer)
- func (c *Client) NewRequest(method string, e Endpoint, suffix string, body interface{}) (*http.Request, error)
- func (c *Client) OSEnv() config.Environment
- func (c *Client) Transport(u *url.URL, access creds.AccessMode) (http.RoundTripper, error)
- func (c *Client) URLConfig() *config.URLConfig
- type ClientError
- type Context
- type Endpoint
- type ReadSeekCloser
- type SSHResolver
Constants ¶
const MediaType = "application/vnd.git-lfs+json; charset=utf-8"
const UrlUnknown = "<unknown>"
Variables ¶
var (
UserAgent = "git-lfs"
)
Functions ¶
func DecodeJSON ¶
func IsDecodeTypeError ¶
func MarshalToRequest ¶
func NewStatusCodeError ¶
Types ¶
type Client ¶
type Client struct { SSH SSHResolver DialTimeout int KeepaliveTimeout int TLSTimeout int ConcurrentTransfers int SkipSSLVerify bool Verbose bool DebuggingVerbose bool VerboseOut io.Writer // contains filtered or unexported fields }
func (*Client) CurrentUser ¶
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) DoWithAccess ¶
DoWithAccess sends an HTTP request to get an HTTP response using the specified access mode. It wraps net/http, adding extra headers, redirection handling, and error reporting.
func (*Client) DoWithRedirect ¶
func (*Client) GitEnv ¶
func (c *Client) GitEnv() config.Environment
func (*Client) HttpClient ¶
func (*Client) LogHTTPStats ¶
func (c *Client) LogHTTPStats(w io.WriteCloser)
func (*Client) LogRequest ¶
LogRequest tells the client to log the request's stats to the http log after the response body has been read.
func (*Client) LogResponse ¶
LogResponse sends the current response stats to the http log.
DEPRECATED: Use LogRequest() instead.
func (*Client) LogStats ¶
LogStats is intended to be called after all HTTP operations for the command have finished. It dumps k/v logs, one line per httpTransfer into a log file with the current timestamp.
DEPRECATED: Call LogHTTPStats() before the first HTTP request.
func (*Client) NewRequest ¶
func (*Client) OSEnv ¶
func (c *Client) OSEnv() config.Environment
func (*Client) Transport ¶
func (c *Client) Transport(u *url.URL, access creds.AccessMode) (http.RoundTripper, error)
type ClientError ¶
type ClientError struct { Message string `json:"message"` DocumentationUrl string `json:"documentation_url,omitempty"` RequestId string `json:"request_id,omitempty"` // contains filtered or unexported fields }
func (*ClientError) Error ¶
func (e *ClientError) Error() string
func (*ClientError) HTTPResponse ¶
func (e *ClientError) HTTPResponse() *http.Response
type Context ¶
type Context interface { GitConfig() *git.Configuration OSEnv() config.Environment GitEnv() config.Environment }
func NewContext ¶
func NewContext(gitConf *git.Configuration, osEnv, gitEnv map[string]string) Context
type Endpoint ¶
type Endpoint struct { Url string SSHMetadata ssh.SSHMetadata Operation string }
An Endpoint describes how to access a Git LFS server.
func EndpointFromBareSshUrl ¶
EndpointFromBareSshUrl constructs a new endpoint from a bare SSH URL:
user@host.com:path/to/repo.git or [user@host.com:port]:path/to/repo.git
func EndpointFromFileUrl ¶
Construct a new endpoint from a file URL
func EndpointFromHttpUrl ¶
Construct a new endpoint from a HTTP URL
func EndpointFromLocalPath ¶
func EndpointFromSshUrl ¶
EndpointFromSshUrl constructs a new endpoint from an ssh:// URL
type ReadSeekCloser ¶
type ReadSeekCloser interface { io.Seeker io.ReadCloser }
func NewByteBody ¶
func NewByteBody(by []byte) ReadSeekCloser