-
Notifications
You must be signed in to change notification settings - Fork 7
/
status.go
41 lines (33 loc) · 856 Bytes
/
status.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
package chkbit
type Status string
const (
StatusPanic Status = "PNC"
StatusErrorDamage Status = "DMG"
StatusErrorIdx Status = "ERX"
StatusUpdateWarnOld Status = "old"
StatusUpdate Status = "upd"
StatusNew Status = "new"
StatusOK Status = "ok "
StatusDeleted Status = "del"
StatusIgnore Status = "ign"
StatusInfo Status = "msg"
// internal
StatusUpdateIndex Status = "xup"
)
func (s Status) String() string {
return (string)(s)
}
func (s Status) IsErrorOrWarning() bool {
return s == StatusPanic || s == StatusErrorDamage || s == StatusErrorIdx || s == StatusUpdateWarnOld
}
func (s Status) IsVerbose() bool {
return s == StatusOK || s == StatusIgnore
}
type LogEvent struct {
Stat Status
Message string
}
type PerfEvent struct {
NumFiles int64
NumBytes int64
}