diff options
author | 2021-09-03 10:27:40 +0100 | |
---|---|---|
committer | 2021-09-03 10:27:40 +0100 | |
commit | 25edd57eaf3eecf0b449a4dabb5b5fc5d6ae7687 (patch) | |
tree | b6cffb65d46a07f59d5393a257973910d4116227 /internal/id/ulid.go | |
parent | session name fix (#185) (diff) | |
parent | review changes (diff) | |
download | gotosocial-25edd57eaf3eecf0b449a4dabb5b5fc5d6ae7687.tar.xz |
Merge pull request #186 from superseriousbusiness/struct_validation
Struct validation
Diffstat (limited to 'internal/id/ulid.go')
-rw-r--r-- | internal/id/ulid.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/id/ulid.go b/internal/id/ulid.go index b488ddfc4..1b0c2e537 100644 --- a/internal/id/ulid.go +++ b/internal/id/ulid.go @@ -10,6 +10,9 @@ import ( const randomRange = 631152381 // ~20 years in seconds +// ULID represents a Universally Unique Lexicographically Sortable Identifier of 26 characters. See https://github.com/oklog/ulid +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) |