[#188] shard: Implement SetMode method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2fb379b7dd
commit
3fa3661cad
2 changed files with 16 additions and 0 deletions
|
@ -40,3 +40,15 @@ func (m Mode) String() string {
|
|||
return "EVACUATE"
|
||||
}
|
||||
}
|
||||
|
||||
// SetMode sets mode of the shard.
|
||||
//
|
||||
// Returns any error encountered that did not allow
|
||||
// to set shard mode.
|
||||
func (s *Shard) SetMode(m Mode) error {
|
||||
s.mode.Store(uint32(m))
|
||||
}
|
||||
|
||||
func (s *Shard) getMode() Mode {
|
||||
return Mode(s.mode.Load())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue