Documentation
¶
Overview ¶
Package githttp wires the smart-HTTP git protocol routes: info/refs + git-upload-pack + git-receive-pack. Each request shells out to canonical `git` plumbing — we don't reimplement the protocol.
This file owns the handler struct + Deps + Mounting; the route bodies live in handler_*.go and the credential resolver lives in auth.go.
Index ¶
Constants ¶
const DefaultMaxPushBytes int64 = 2 * 1024 * 1024 * 1024 // 2 GiB
DefaultMaxPushBytes is the spec-recommended cap.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Logger *slog.Logger
Pool *pgxpool.Pool
RepoFS *storage.RepoFS
// MaxPushBytes is the hard cap on the git-receive-pack request body.
// Defaults to 2 GiB when zero.
MaxPushBytes int64
}
Deps wires the git-HTTP handler set.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers is the registered handler set. Construct via New.
func (*Handlers) MountSmartHTTP ¶
MountSmartHTTP registers the smart-HTTP routes on r. Caller is responsible for placing this group ahead of any conflicting routes (specifically, register before the /{owner}/{repo} two-segment route from S11 — `.git` URLs would otherwise be eaten by it).
Caller is also responsible for stripping CSRF, response-compression, and request-timeout middleware from this group; see web/server.go.