Documentation
¶
Overview ¶
Package service implements the protocol-independent receive-pack service.
A Service borrows the stores, roots, hooks, and I/O endpoints supplied in Options. Callers retain ownership of those dependencies and must keep them valid for each Execute call that uses them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandResult ¶
type CommandResult struct {
Name string
Error string
RefName string
OldID *objectid.ObjectID
NewID *objectid.ObjectID
ForcedUpdate bool
}
CommandResult is one per-command execution result.
type Hook ¶
type Hook func(context.Context, HookRequest) ([]UpdateDecision, error)
Hook is an optional per-request validation hook.
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 view passed to one Hook invocation.
Labels: Life-Call.
type Options ¶
type Options struct {
Algorithm objectid.Algorithm
Refs refstore.ReadWriteStore
ExistingObjects objectstore.Reader
CommitGraph *commitgraphread.Reader
ObjectsRoot *os.Root
Progress iowrap.WriteFlusher
PromotedObjectPermissions *PromotedObjectPermissions
Hook Hook
HookIO HookIO
}
Options configures one protocol-independent receive-pack service.
Service borrows all configured dependencies.
Refs and ExistingObjects are required and must be non-nil. ObjectsRoot is required if Execute may need to ingest or promote a pack. Progress, Hook, and HookIO are optional; when provided they are also borrowed for the duration of Execute.
type PlannedUpdate ¶
type PlannedUpdate struct {
Name string
OldID objectid.ObjectID
NewID objectid.ObjectID
Delete bool
}
PlannedUpdate is one ref update that would be applied once ref writing exists.
type Request ¶
type Request struct {
Commands []Command
PushOptions []string
Atomic bool
DeleteOnly bool
PackExpected bool
Pack io.Reader
}
Request is one protocol-independent receive-pack execution request.
If PackExpected is true, Pack must be non-nil and remain valid until Execute finishes consuming it.
type Result ¶
type Result struct {
UnpackError string
Commands []CommandResult
Ingest *ingest.Result
Planned []PlannedUpdate
Applied bool
}
Result is one receive-pack execution result.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service executes protocol-independent receive-pack requests.