snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s
Some checks failed
master / ci (push) Failing after 0s
This commit is contained in:
24
uuid.go
Normal file
24
uuid.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package watermill
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/lithammer/shortuuid/v3"
|
||||
"github.com/oklog/ulid"
|
||||
)
|
||||
|
||||
// NewUUID returns a new UUID Version 4.
|
||||
func NewUUID() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
|
||||
// NewShortUUID returns a new short UUID.
|
||||
func NewShortUUID() string {
|
||||
return shortuuid.New()
|
||||
}
|
||||
|
||||
// NewULID returns a new ULID.
|
||||
func NewULID() string {
|
||||
return ulid.MustNew(ulid.Now(), rand.Reader).String()
|
||||
}
|
||||
Reference in New Issue
Block a user