forked from TrueCloudLab/frostfs-node
[#211] blobovnicza: Refactor ID implementation
Replace UUID implementation of ID with byte slice. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
53b114cf8b
commit
3028718691
1 changed files with 6 additions and 6 deletions
|
@ -1,17 +1,17 @@
|
||||||
package blobovnicza
|
package blobovnicza
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/uuid"
|
"encoding/hex"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ID represents Blobovnicza identifier.
|
// ID represents Blobovnicza identifier.
|
||||||
type ID uuid.UUID
|
type ID []byte
|
||||||
|
|
||||||
// NewIDFromUUID constructs ID from UUID instance.
|
// NewIDFromBytes constructs ID from byte slice.
|
||||||
func NewIDFromUUID(uid uuid.UUID) *ID {
|
func NewIDFromBytes(v []byte) *ID {
|
||||||
return (*ID)(&uid)
|
return (*ID)(&v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (id ID) String() string {
|
func (id ID) String() string {
|
||||||
return (uuid.UUID)(id).String()
|
return hex.EncodeToString(id)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue