rbd: add String method for MirrorImageState

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-03-17 15:52:59 -04:00 committed by mergify[bot]
parent 741e7d43bd
commit b614e93b9d
1 changed files with 14 additions and 0 deletions

View File

@ -207,6 +207,20 @@ const (
MirrorImageDisabled = MirrorImageState(C.RBD_MIRROR_IMAGE_DISABLED)
)
// String representation of MirrorImageState.
func (mis MirrorImageState) String() string {
switch mis {
case MirrorImageDisabling:
return "disabling"
case MirrorImageEnabled:
return "enabled"
case MirrorImageDisabled:
return "disabled"
default:
return "<unknown>"
}
}
// MirrorImageInfo represents the mirroring status information of a RBD image.
type MirrorImageInfo struct {
GlobalID string