health.go 593 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
package sealed_sector_health

// Health represents the healthiness of a sector managed by a
// sector builder.
type Health int

const (
	Unknown              Health = iota
	Ok                          // everything is fine
	ErrorInvalidChecksum        // sector exists, but checksum is invalid
	ErrorInvalidLength          // sector exists, but length is incorrect
	ErrorMissing                // sector no longer exists
)
14
15
16
17
18
19
20
21
22
23
24
25

var labels = [...]string{
	"Unknown",
	"Ok",
	"ErrorInvalidChecksum",
	"ErrorInvalidLength",
	"ErrorMissing",
}

func (el Health) String() string {
	return labels[el]
}