diff options
author | 2021-08-29 16:52:23 +0200 | |
---|---|---|
committer | 2021-08-29 16:53:23 +0200 | |
commit | 7c45403b24d757081e11ecf3c121a692f7555154 (patch) | |
tree | f76ac2c19d361bb58d86f5de68bc8e823f9d9164 /internal/id/ulid.go | |
parent | Add SQLite support, fix un-thread-safe DB caches, small performance f… (#172) (diff) | |
download | gotosocial-7c45403b24d757081e11ecf3c121a692f7555154.tar.xz |
start working on struct validation for gtsmodel
Diffstat (limited to 'internal/id/ulid.go')
-rw-r--r-- | internal/id/ulid.go | 2 |
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) |