aboutsummaryrefslogtreecommitdiff
path: root/core/core.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:38:40 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:38:40 +0200
commita9927763f43d59c418b264790ccee59defe8ca29 (patch)
tree5dfc4f1f1f29d1ef1cbca3406bf57d1667b93f76 /core/core.go
parented23d402fec268e163ec895748f43e3254ba3dfd (diff)
refactor: Rename packages for clarityv0.3.0
Diffstat (limited to 'core/core.go')
-rw-r--r--core/core.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/core/core.go b/core/core.go
deleted file mode 100644
index 5cd654d..0000000
--- a/core/core.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package core
-
-import (
- "encoding/base64"
-
- "github.com/gofrs/uuid"
-)
-
-type ID struct {
- uuid.UUID
-}
-
-func NewID() ID {
- id, err := uuid.NewV4()
- Expect(err, "error generating uuid")
-
- return ID{id}
-}
-
-func (id ID) String() string {
- return base64.RawURLEncoding.EncodeToString(id.Bytes())
-}
-
-func ParseID(value string) (ID, error) {
- bytes, err := base64.RawURLEncoding.DecodeString(value)
- if err != nil {
- return ID{}, Wrap(err, "error decoding value")
- }
- id, err := uuid.FromBytes(bytes)
- if err != nil {
- return ID{}, Wrap(err, "error parsing uuid")
- }
- return ID{id}, nil
-}