chkbit/status.go

39 lines
807 B
Go
Raw Permalink Normal View History

2024-08-16 23:10:58 +02:00
package chkbit
2024-08-15 23:30:29 +02:00
type Status string
const (
STATUS_PANIC Status = "EXC"
STATUS_ERR_IDX Status = "EIX"
2024-08-18 21:36:22 +02:00
STATUS_ERR_DMG Status = "DMG"
STATUS_UPDATE_INDEX Status = "iup"
STATUS_UP_WARN_OLD Status = "old"
2024-08-15 23:30:29 +02:00
STATUS_UPDATE Status = "upd"
2024-08-18 21:36:22 +02:00
STATUS_NEW Status = "new"
2024-08-15 23:30:29 +02:00
STATUS_OK Status = "ok "
STATUS_IGNORE Status = "ign"
STATUS_MISSING Status = "del"
2024-08-15 23:30:29 +02:00
)
func (s Status) String() string {
return (string)(s)
}
func (s Status) IsErrorOrWarning() bool {
2024-08-18 21:36:22 +02:00
return s == STATUS_PANIC || s == STATUS_ERR_DMG || s == STATUS_ERR_IDX || s == STATUS_UP_WARN_OLD
2024-08-15 23:30:29 +02:00
}
func (s Status) IsVerbose() bool {
return s == STATUS_OK || s == STATUS_IGNORE
}
type LogEvent struct {
Stat Status
Message string
}
type PerfEvent struct {
NumFiles int64
NumBytes int64
}