diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-10-24 08:38:40 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2023-10-24 08:38:40 +0200 |
| commit | a9927763f43d59c418b264790ccee59defe8ca29 (patch) | |
| tree | 5dfc4f1f1f29d1ef1cbca3406bf57d1667b93f76 /core/core.go | |
| parent | ed23d402fec268e163ec895748f43e3254ba3dfd (diff) | |
refactor: Rename packages for clarityv0.3.0
Diffstat (limited to 'core/core.go')
| -rw-r--r-- | core/core.go | 34 |
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 -} |
