-
Notifications
You must be signed in to change notification settings - Fork 6
/
messages.go
112 lines (91 loc) · 3.27 KB
/
messages.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package sub
import (
"time"
"github.com/Cloud-Foundations/Dominator/lib/filesystem"
"github.com/Cloud-Foundations/Dominator/lib/hash"
"github.com/Cloud-Foundations/Dominator/lib/objectcache"
"github.com/Cloud-Foundations/Dominator/lib/triggers"
)
const (
DisruptionStateAnytime = 0 // Not implemented or configured.
DisruptionStatePermitted = 1
DisruptionStateRequested = 2
DisruptionStateDenied = 3
ErrorDisruptionPending = "disruption pending"
ErrorDisruptionDenied = "disruption denied"
)
type BoostCpuLimitRequest struct{}
type BoostCpuLimitResponse struct{}
type CleanupRequest struct {
Hashes []hash.Hash
}
type CleanupResponse struct{}
type DisruptionState uint
type FetchRequest struct {
LockFor time.Duration // Duration to lock other clients from mutating.
ServerAddress string
Wait bool
Hashes []hash.Hash
}
type FetchResponse struct {
LockedUntil time.Time
}
type GetConfigurationRequest struct{}
type GetConfigurationResponse Configuration
// The GetFiles() RPC is fully streamed.
// The client sends a stream of strings (filenames) it wants. An empty string
// signals the end of the stream.
// The server (the sub) sends a stream of GetFileResponse messages. No response
// is sent for the end-of-stream signal.
type GetFileResponse struct {
Error string
Size uint64
} // File data are streamed afterwards.
type PollRequest struct {
HaveGeneration uint64
LockFor time.Duration
ShortPollOnly bool // If true, do not send FileSystem or ObjectCache.
}
type PollResponse struct {
NetworkSpeed uint64 // Capacity of the network interface.
CurrentConfiguration Configuration
FetchInProgress bool // Fetch() and Update() mutually exclusive
UpdateInProgress bool
InitialImageName string
LastFetchError string
LastNote string // Updated after successful Update().
LastSuccessfulImageName string
LastUpdateError string
LastUpdateHadTriggerFailures bool
LastWriteError string
LockedByAnotherClient bool // Fetch() and Update() restricted.
LockedUntil time.Time
FreeSpace *uint64
StartTime time.Time
PollTime time.Time
ScanCount uint64
DurationOfLastScan time.Duration
GenerationCount uint64
SystemUptime *time.Duration
DisruptionState DisruptionState
FileSystemFollows bool
FileSystem *filesystem.FileSystem // Streamed separately.
ObjectCache objectcache.ObjectCache // Streamed separately.
} // FileSystem is encoded afterwards, followed by ObjectCache.
type SetConfigurationRequest Configuration
type SetConfigurationResponse struct{}
type UpdateRequest struct {
ForceDisruption bool
ImageName string
Wait bool
// The ordering here reflects the ordering that the sub is expected to use.
FilesToCopyToCache []FileToCopyToCache
DirectoriesToMake []Inode
InodesToMake []Inode
HardlinksToMake []Hardlink
PathsToDelete []string
InodesToChange []Inode
MultiplyUsedObjects map[hash.Hash]uint64
Triggers *triggers.Triggers
}
type UpdateResponse struct{}