Documentation ¶
Overview ¶
Package http implements a HTTP client for go-git.
Index ¶
- func NewGitUploadPackService(endpoint common.Endpoint) common.GitUploadPackService
- func NewHTTPError(r *http.Response) error
- type BasicAuth
- type GitUploadPackService
- func (s *GitUploadPackService) Connect() error
- func (s *GitUploadPackService) Disconnect() (err error)
- func (s *GitUploadPackService) Fetch(r *common.GitUploadPackRequest) (io.ReadCloser, error)
- func (s *GitUploadPackService) Info() (*common.GitUploadPackInfo, error)
- func (s *GitUploadPackService) SetAuth(auth common.AuthMethod) error
- type HTTPAuthMethod
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGitUploadPackService ¶
func NewGitUploadPackService(endpoint common.Endpoint) common.GitUploadPackService
NewGitUploadPackService connects to a git-upload-pack service over HTTP, the auth is extracted from the URL, or can be provided using the SetAuth method
func NewHTTPError ¶
NewHTTPError returns a new HTTPError based on a http response
Types ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
BasicAuth represent a HTTP basic auth
func NewBasicAuth ¶
NewBasicAuth returns a BasicAuth base on the given user and password
type GitUploadPackService ¶
type GitUploadPackService struct {
// contains filtered or unexported fields
}
GitUploadPackService git-upoad-pack service over HTTP
func (*GitUploadPackService) Connect ¶
func (s *GitUploadPackService) Connect() error
Connect has not any effect, is here just for meet the interface
func (*GitUploadPackService) Disconnect ¶
func (s *GitUploadPackService) Disconnect() (err error)
Disconnect do nothing
func (*GitUploadPackService) Fetch ¶
func (s *GitUploadPackService) Fetch(r *common.GitUploadPackRequest) (io.ReadCloser, error)
Fetch request and returns a reader to a packfile
func (*GitUploadPackService) Info ¶
func (s *GitUploadPackService) Info() (*common.GitUploadPackInfo, error)
Info returns the references info and capabilities from the service
func (*GitUploadPackService) SetAuth ¶
func (s *GitUploadPackService) SetAuth(auth common.AuthMethod) error
SetAuth sets the AuthMethod
type HTTPAuthMethod ¶
type HTTPAuthMethod interface { common.AuthMethod // contains filtered or unexported methods }
HTTPAuthMethod concrete implementation of common.AuthMethod for HTTP services
type HTTPError ¶
HTTPError a dedicated error to return errors bases on status codes
func (*HTTPError) StatusCode ¶
StatusCode returns the status code of the response