From 36175632e0652302ed8b376fdcef2d4020143915 Mon Sep 17 00:00:00 2001 From: netbenix Date: Mon, 31 Jan 2022 20:10:37 +0100 Subject: [PATCH] refactor(RemoteStoage): Added String() func --- SQL/RemoteStorage.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/SQL/RemoteStorage.go b/SQL/RemoteStorage.go index dd835c0..7c3ae82 100644 --- a/SQL/RemoteStorage.go +++ b/SQL/RemoteStorage.go @@ -1,9 +1,24 @@ package SQL +import "fmt" + type RemoteStorageType int64 -const( +const ( REMOTE_AZURE_FILE = 1 REMOTE_AZURE_BLOB = 2 - REMOTE_NONE = 3 -) \ No newline at end of file + REMOTE_NONE = 3 +) + +func (e RemoteStorageType) String() string { + switch e { + case REMOTE_AZURE_FILE: + return "AZURE-FILE" + case REMOTE_AZURE_BLOB: + return "AZURE-BLOB" + case REMOTE_NONE: + return "NONE" + default: + return fmt.Sprintf("%d", e) + } +}