[#188] shard: Define the enumeration of shard modes

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2020-11-19 15:41:10 +03:00 committed by Alex Vanin
parent 0b515837ca
commit 2fb379b7dd
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
package shard
// Mode represents enumeration of Shard work modes.
type Mode uint32
// TODO: more detailed description of shard modes.
const (
_ Mode = iota
// ModeActive is a Mode value for active shard.
ModeActive
// ModeInactive is a Mode value for inactive shard.
ModeInactive
// ModeReadOnly is a Mode value for read-only shard.
ModeReadOnly
// ModeFault is a Mode value for faulty shard.
ModeFault
// ModeEvacuate is a Mode value for evacuating shard.
ModeEvacuate
)
func (m Mode) String() string {
switch m {
default:
return "UNDEFINED"
case ModeActive:
return "ACTIVE"
case ModeInactive:
return "INACTIVE"
case ModeReadOnly:
return "READ_ONLY"
case ModeFault:
return "FAULT"
case ModeEvacuate:
return "EVACUATE"
}
}