aboutsummaryrefslogtreecommitdiff
path: root/receivepack/service/options.go
blob: a49b6b95b4561446217a5e0a7028c77a0af4cf9d (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
package service

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

	"codeberg.org/lindenii/furgit/objectid"
	"codeberg.org/lindenii/furgit/objectstore"
	"codeberg.org/lindenii/furgit/refstore"
)

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.Store
	ObjectsRoot               *os.Root
	Progress                  io.Writer
	ProgressFlush             func() error
	PromotedObjectPermissions *PromotedObjectPermissions
	Hook                      Hook
	HookIO                    HookIO
}