git

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2015 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	RouteGitInfoRefs    = "git.info-refs"
	RouteGitUploadPack  = "git.upload-pack"
	RouteGitReceivePack = "git.receive-pack"
)
View Source
const (
	ServiceReceivePack = "receive-pack"
	ServiceUploadPack  = "upload-pack"
)

Variables

View Source
var GitMatcher mux.MatcherFunc = func(req *http.Request, rt *mux.RouteMatch) bool {
	userAgent := req.Header.Get("User-Agent")
	if strings.HasPrefix(strings.ToLower(userAgent), "git/") {
		return true
	}
	return false
}

Functions

func NewRouter

func NewRouter(base *mux.Router) *mux.Router

New creates a new Git HTTP router.

Types

type GitTransport

type GitTransport interface {
	// InfoRefs writes the output of git-info-refs to w.
	InfoRefs(w io.Writer, service string) error

	// ReceivePack writes the output of git-receive-pack to w, reading
	// from r.
	ReceivePack(w io.Writer, r io.Reader, opt GitTransportOpt) error

	// UploadPack writes the output of git-upload-pack to w, reading
	// from r.
	UploadPack(w io.Writer, r io.Reader, opt GitTransportOpt) error
}

GitTransport represents a git repository with all the functions to support the "smart" transfer protocol.

type GitTransportOpt

type GitTransportOpt struct {
	ContentEncoding string
}

type GitTransporter

type GitTransporter interface {
	GitTransport(repoPath string) (GitTransport, error)
}

Jump to

Keyboard shortcuts

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