http

package
v4.0.0-rc4+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package http implements a HTTP client for go-git.

Index

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

func NewHTTPError(r *http.Response) error

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

func NewBasicAuth(username, password string) *BasicAuth

NewBasicAuth returns a BasicAuth base on the given user and password

func (*BasicAuth) Name

func (a *BasicAuth) Name() string

Name name of the auth

func (*BasicAuth) String

func (a *BasicAuth) String() string

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

Fetch request and returns a reader to a packfile

func (*GitUploadPackService) Info

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

type HTTPError struct {
	Response *http.Response
}

HTTPError a dedicated error to return errors bases on status codes

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) StatusCode

func (e *HTTPError) StatusCode() int

StatusCode returns the status code of the response

Jump to

Keyboard shortcuts

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