From 406868763c27feaf82e8d3a1b2286f00a25349e4 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 17 Mar 2021 15:52:19 -0400 Subject: [PATCH] rbd: add String method for MirrorMode Signed-off-by: John Mulligan --- rbd/mirror.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rbd/mirror.go b/rbd/mirror.go index 1087494..2a4f616 100644 --- a/rbd/mirror.go +++ b/rbd/mirror.go @@ -31,6 +31,20 @@ const ( MirrorModePool = MirrorMode(C.RBD_MIRROR_MODE_POOL) ) +// String representation of MirrorMode. +func (m MirrorMode) String() string { + switch m { + case MirrorModeDisabled: + return "disabled" + case MirrorModeImage: + return "image" + case MirrorModePool: + return "pool" + default: + return "" + } +} + // ImageMirrorMode is used to indicate the mirroring approach for an RBD image. type ImageMirrorMode int64