Documentation
¶
Overview ¶
Package githttp serves the Git Smart HTTP protocol backed by system git-http-backend. Routes:
GET /{owner}/{repo}.git/info/refs?service=git-{upload,receive}-pack
POST /{owner}/{repo}.git/git-upload-pack
POST /{owner}/{repo}.git/git-receive-pack
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler wraps the gitstore for HTTP git protocol serving.
func (*Handler) InfoRefs ¶
func (h *Handler) InfoRefs(w http.ResponseWriter, r *http.Request)
InfoRefs handles GET /{owner}/{repo}.git/info/refs?service=git-*
func (*Handler) ReceivePack ¶
func (h *Handler) ReceivePack(w http.ResponseWriter, r *http.Request)
ReceivePack handles POST /{owner}/{repo}.git/git-receive-pack (push)
func (*Handler) UploadPack ¶
func (h *Handler) UploadPack(w http.ResponseWriter, r *http.Request)
UploadPack handles POST /{owner}/{repo}.git/git-upload-pack (clone/fetch)
type Store ¶
type Store interface {
Exists(ctx context.Context, fullName string) bool
Init(ctx context.Context, fullName, defaultBranch string, seed bool) error
GetRepoPath(ctx context.Context, fullName string) (string, error)
RepoRoot(ctx context.Context) (string, error)
WithRepoLock(ctx context.Context, fullName string, fn func() error) error
}
Store defines the git storage operations required by the HTTP handler.
Click to show internal directories.
Click to hide internal directories.