-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverapi.go
47 lines (36 loc) · 1 KB
/
serverapi.go
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
39
40
41
42
43
44
45
46
47
package tkserver
import (
"errors"
"github.com/bindernews/taki/pkg/fsdiff"
)
// Line that is printed prior to switching to binary encoding
const SERVER_START_LINE = "--TAKI SERVER START--"
// Error returned by task APIs when the task isn't found
var ErrTaskNotExist = errors.New("task does not exist")
// Error when a task does not implement the Progressive interface
var ErrTaskNotProgressive = errors.New("task does not implement Progressive")
// Indicates that a task has not started
var ErrTaskNotStarted = errors.New("task not started")
type Empty struct{}
type GetRootsRes struct {
Roots []string
}
type GenerateDiffReq struct {
Base *fsdiff.DirMeta
}
type CollectFilesRes struct {
// Number of bytes collected
Bytes int64
// Total number of bytes to collect
Total int
// Is the task fully complete
Done bool
}
type ServerConfig struct {
// Root path to collect and diff from
Root string
// List of exclusions (relative to root)
Exclude []string
// Output path for CollectFiles
Output string
}