ref: 94011e3762ca25b8ab3a9b9fe0d7a9e155381477
dir: /receivepack/service/hook.go/
package service
import (
"context"
"io"
"codeberg.org/lindenii/furgit/objectid"
"codeberg.org/lindenii/furgit/objectstore"
"codeberg.org/lindenii/furgit/refstore"
)
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
}
type HookRequest struct {
Refs refstore.ReadingStore
ExistingObjects objectstore.Store
QuarantinedObjects objectstore.Store
Updates []RefUpdate
PushOptions []string
IO HookIO
}
type Hook func(context.Context, HookRequest) ([]UpdateDecision, error)