git

package
v0.0.0-...-7dc7b4a Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: BSD-3-Clause Imports: 4 Imported by: 4

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