From 3d25bda9d5da6814661828adabe8a09f9d01aefb Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 26 Mar 2026 09:14:59 +0000 Subject: network/receivepack: Rename from receivepack --- receivepack/service/hook.go | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 receivepack/service/hook.go (limited to 'receivepack/service/hook.go') diff --git a/receivepack/service/hook.go b/receivepack/service/hook.go deleted file mode 100644 index 750720dd..00000000 --- a/receivepack/service/hook.go +++ /dev/null @@ -1,45 +0,0 @@ -package service - -import ( - "context" - "io" - - objectid "codeberg.org/lindenii/furgit/object/id" - objectstorer "codeberg.org/lindenii/furgit/object/storer" - refstore "codeberg.org/lindenii/furgit/ref/store" -) - -type HookIO struct { - Progress io.Writer - Error io.Writer -} - -type RefUpdate struct { - Name string - OldID objectid.ObjectID - NewID objectid.ObjectID -} - -type UpdateDecision struct { - Accept bool - Message string -} - -// HookRequest is the borrowed view passed to one Hook invocation. -// -// Refs, ExistingObjects, and QuarantinedObjects are borrowed and are only -// valid for the duration of the hook call. -type HookRequest struct { - Refs refstore.ReadingStore - ExistingObjects objectstorer.Store - QuarantinedObjects objectstorer.Store - Updates []RefUpdate - PushOptions []string - IO HookIO -} - -// Hook is an optional per-request validation hook. -// -// Hook borrows the data and stores in HookRequest only for the duration of the -// call. -type Hook func(context.Context, HookRequest) ([]UpdateDecision, error) -- cgit v1.3.1-10-gc9f91