Documentation
¶
Overview ¶
Package receivepack provides the application-facing server-side push entry point.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingAlgorithm reports one missing repository hash algorithm. ErrMissingAlgorithm = errors.New("receivepack: missing object id algorithm") // ErrMissingRefs reports one missing reference store dependency. ErrMissingRefs = errors.New("receivepack: missing refs store") // ErrMissingObjects reports one missing object store dependency. ErrMissingObjects = errors.New("receivepack: missing objects store") // ErrUnsupportedProtocol reports one unsupported requested Git protocol // version. ErrUnsupportedProtocol = errors.New("receivepack: unsupported protocol version") )
Functions ¶
Types ¶
type Hook ¶
type Hook func(context.Context, HookRequest) ([]UpdateDecision, error)
Hook decides whether each requested update should proceed.
The hook runs after pack ingestion into quarantine and before quarantine promotion or ref updates. The returned decisions must have the same length as HookRequest.Updates.
type HookIO ¶
type HookIO struct {
Progress iowrap.WriteFlusher
Error iowrap.WriteFlusher
}
type HookRequest ¶
type HookRequest struct {
Refs refstore.ReadingStore
ExistingObjects objectstore.Reader
QuarantinedObjects objectstore.Reader
CommitGraph *commitgraphread.Reader
Updates []RefUpdate
PushOptions []string
IO HookIO
}
HookRequest is the input presented to a receive-pack hook before quarantine promotion and ref updates.
Labels: Life-Call.
type Options ¶
type Options struct {
// GitProtocol is the raw Git protocol version string from the transport,
// such as "version=1".
GitProtocol string
// Algorithm is the repository object ID algorithm used by the push session.
Algorithm objectid.Algorithm
// Refs is the reference store visible to the push.
Refs refstore.ReadWriteStore
// ExistingObjects is the object store visible to the push before any newly
// uploaded quarantined objects are promoted.
ExistingObjects objectstore.Reader
// CommitGraph is an optional commit-graph snapshot corresponding to
// ExistingObjects.
CommitGraph *commitgraphread.Reader
// ObjectsRoot is the permanent object storage root beneath which per-push
// quarantine directories are derived.
ObjectsRoot *os.Root
// PromotedObjectPermissions, when non-nil, is applied to objects and
// directories moved from quarantine into the permanent object store.
PromotedObjectPermissions *PromotedObjectPermissions
// Hook, when non-nil, runs after pack ingestion into quarantine and before
// quarantine promotion or ref updates. Hook is borrowed for the duration of
// ReceivePack.
Hook Hook
// Agent is the receive-pack agent string advertised via capability.
//
// When empty, ReceivePack derives one from build info and falls back to
// "furgit".
Agent string
// SessionID is the advertised receive-pack session-id capability value.
//
// When empty, ReceivePack generates one random value per invocation.
SessionID string
// PushCertNonce is the advertised push-cert nonce capability value.
//
// When empty, ReceivePack generates one random value per invocation.
PushCertNonce string
}
Options configures one receive-pack invocation.
ReceivePack borrows all configured dependencies.
Refs and ExistingObjects are required and must be non-nil. ObjectsRoot is required if the invocation may need to ingest or promote a pack.
type PromotedObjectPermissions ¶
PromotedObjectPermissions configures the destination permissions applied to objects and directories promoted out of quarantine.
type UpdateDecision ¶
UpdateDecision is one hook decision for a requested reference update.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package hooks provides a few pre-defined hooks that callers might find useful.
|
Package hooks provides a few pre-defined hooks that callers might find useful. |
|
Package service implements the protocol-independent receive-pack service.
|
Package service implements the protocol-independent receive-pack service. |