From 302871869190e0d9b8049369c9df3d3e54d235b8 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 25 Nov 2020 18:55:40 +0300 Subject: [PATCH] [#211] blobovnicza: Refactor ID implementation Replace UUID implementation of ID with byte slice. Signed-off-by: Leonard Lyubich --- pkg/local_object_storage/blobovnicza/id.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/local_object_storage/blobovnicza/id.go b/pkg/local_object_storage/blobovnicza/id.go index 23e94fb82..e5bbc7c48 100644 --- a/pkg/local_object_storage/blobovnicza/id.go +++ b/pkg/local_object_storage/blobovnicza/id.go @@ -1,17 +1,17 @@ package blobovnicza import ( - "github.com/google/uuid" + "encoding/hex" ) // ID represents Blobovnicza identifier. -type ID uuid.UUID +type ID []byte -// NewIDFromUUID constructs ID from UUID instance. -func NewIDFromUUID(uid uuid.UUID) *ID { - return (*ID)(&uid) +// NewIDFromBytes constructs ID from byte slice. +func NewIDFromBytes(v []byte) *ID { + return (*ID)(&v) } func (id ID) String() string { - return (uuid.UUID)(id).String() + return hex.EncodeToString(id) }