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 ¶
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)
}
Click to show internal directories.
Click to hide internal directories.