forked from Graphmasters/occamy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.go
56 lines (44 loc) · 1.56 KB
/
constants.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
package occamy
// region Process Names
const (
ProcessHandleRequestMessage = "handle_request_message"
ProcessHandleControlMessage = "handle_control_message"
ProcessExpansion = "expansion_process"
)
// endregion
// region Slot Status (exported)
type SlotStatus string
const (
SlotStatusEmpty SlotStatus = "empty"
SlotStatusProtected SlotStatus = "protected"
SlotStatusUnprotectedInternal SlotStatus = "unprotected_internal"
SlotStatusUnprotectedExternal SlotStatus = "unprotected_external"
)
// endregion
// region Slot Status (unexported)
// slotStatus represents the status of a slot as in integer. This makes it
// easier for comparisons. This isn't exported in case we wish to include
// another status at a future date.
type slotStatus uint8
const (
slotStatusEmpty slotStatus = iota // The slot is empty.
slotStatusUnprotectedExternal // The slot contains an unprotected external task
slotStatusUnprotectedInternal // The slot contains an unprotected internal task
slotStatusProtected // The slot contains a protected task which must be done (i.e. only killed during shutdown).
numSlotStatuses
)
func (s slotStatus) export() SlotStatus {
switch s {
case slotStatusEmpty:
return SlotStatusEmpty
case slotStatusUnprotectedExternal:
return SlotStatusUnprotectedExternal
case slotStatusUnprotectedInternal:
return SlotStatusUnprotectedInternal
case slotStatusProtected:
return SlotStatusProtected
default:
return "undefined"
}
}
// endregion