aboutsummaryrefslogtreecommitdiff
path: root/network/receivepack/service/options.go
blob: ab867bceb4aa65b527244e69e1d073cdbd7b3a86 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package service

import (
	"io"
	"io/fs"
	"os"

	commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
	objectid "codeberg.org/lindenii/furgit/object/id"
	objectstore "codeberg.org/lindenii/furgit/object/store"
	refstore "codeberg.org/lindenii/furgit/ref/store"
)

type PromotedObjectPermissions struct {
	DirMode  fs.FileMode
	FileMode fs.FileMode
}

// 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, ProgressFlush, Hook, and HookIO are optional; when provided they
// are also borrowed for the duration of Execute.
type Options struct {
	Algorithm                 objectid.Algorithm
	Refs                      refstore.ReadWriteStore
	ExistingObjects           objectstore.ReadingStore
	CommitGraph               *commitgraphread.Reader
	ObjectsRoot               *os.Root
	Progress                  io.Writer
	ProgressFlush             func() error
	PromotedObjectPermissions *PromotedObjectPermissions
	Hook                      Hook
	HookIO                    HookIO
}