summaryrefslogtreecommitdiff
path: root/internal/id/ulid.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-08-29 16:52:23 +0200
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2021-09-01 11:11:26 +0200
commitd2276fc553332477740e2c320d51a9cbc3cf2585 (patch)
treee02e1433afeedbd442d8d9202ddad8a1261b549e /internal/id/ulid.go
parentImprove GetRemoteStatus and db.GetStatus() logic (#174) (diff)
downloadgotosocial-d2276fc553332477740e2c320d51a9cbc3cf2585.tar.xz
start working on struct validation for gtsmodel
Diffstat (limited to 'internal/id/ulid.go')
-rw-r--r--internal/id/ulid.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/id/ulid.go b/internal/id/ulid.go
index b488ddfc4..f9fbd4d88 100644
--- a/internal/id/ulid.go
+++ b/internal/id/ulid.go
@@ -10,6 +10,8 @@ import (
const randomRange = 631152381 // ~20 years in seconds
+type ULID string
+
// NewULID returns a new ULID string using the current time, or an error if something goes wrong.
func NewULID() (string, error) {
newUlid, err := ulid.New(ulid.Timestamp(time.Now()), rand.Reader)