diff options
Diffstat (limited to 'network/receivepack/service')
| -rw-r--r-- | network/receivepack/service/execute.go | 2 | ||||
| -rw-r--r-- | network/receivepack/service/hook.go | 8 | ||||
| -rw-r--r-- | network/receivepack/service/service.go | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/network/receivepack/service/execute.go b/network/receivepack/service/execute.go index 9f373e0d..5b00dba5 100644 --- a/network/receivepack/service/execute.go +++ b/network/receivepack/service/execute.go @@ -9,6 +9,8 @@ import ( // Execute validates one receive-pack request, optionally ingests its pack into // quarantine, runs the optional hook, and applies allowed ref updates. +// +// Labels: Deps-Borrowed. func (service *Service) Execute(ctx context.Context, req *Request) (*Result, error) { result := &Result{ Commands: make([]CommandResult, 0, len(req.Commands)), diff --git a/network/receivepack/service/hook.go b/network/receivepack/service/hook.go index e3afa375..66ff0929 100644 --- a/network/receivepack/service/hook.go +++ b/network/receivepack/service/hook.go @@ -26,10 +26,9 @@ type UpdateDecision struct { Message string } -// HookRequest is the borrowed view passed to one Hook invocation. +// HookRequest is the view passed to one Hook invocation. // -// Refs, ExistingObjects, QuarantinedObjects, and CommitGraph are borrowed and -// are only valid for the duration of the hook call. +// Labels: Life-Call. type HookRequest struct { Refs refstore.ReadingStore ExistingObjects objectstore.ReadingStore @@ -42,6 +41,5 @@ type HookRequest struct { // Hook is an optional per-request validation hook. // -// Hook borrows the data and stores in HookRequest only for the duration of the -// call. +// The returned decisions must have the same length as HookRequest.Updates. type Hook func(context.Context, HookRequest) ([]UpdateDecision, error) diff --git a/network/receivepack/service/service.go b/network/receivepack/service/service.go index a57fd354..0538cf73 100644 --- a/network/receivepack/service/service.go +++ b/network/receivepack/service/service.go @@ -1,16 +1,13 @@ package service // Service executes protocol-independent receive-pack requests. -// -// Service borrows all dependencies supplied in Options. type Service struct { opts Options } // New creates one receive-pack service. // -// The returned service borrows opts and does not take ownership of any stores, -// roots, hooks, or I/O endpoints reachable through it. +// Labels: Deps-Borrowed. func New(opts Options) *Service { return &Service{opts: opts} } |
