summaryrefslogtreecommitdiff
path: root/core/core.go
diff options
context:
space:
mode:
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
-}