forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiface.go
More file actions
26 lines (22 loc) · 685 Bytes
/
iface.go
File metadata and controls
26 lines (22 loc) · 685 Bytes
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
package uploadhandler
import (
"context"
)
type Upload[T any] struct {
ID int
State string
NumParts int
UploadedParts []int
UploadSize *int64
UncompressedSize *int64
Metadata T
}
type DBStore[T any] interface {
Transact(ctx context.Context) (DBStore[T], error)
Done(err error) error
GetUploadByID(ctx context.Context, uploadID int) (Upload[T], bool, error)
InsertUpload(ctx context.Context, upload Upload[T]) (int, error)
AddUploadPart(ctx context.Context, uploadID, partIndex int) error
MarkQueued(ctx context.Context, id int, uploadSize *int64) error
MarkFailed(ctx context.Context, id int, reason string) error
}