mirror of
https://github.com/wahyd4/badger.git
synced 2026-08-08 21:05:55 +10:00
19 lines
313 B
Go
19 lines
313 B
Go
package handlers
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
|
|
"github.com/oklog/ulid"
|
|
)
|
|
|
|
func NewULID() string {
|
|
now := time.Now()
|
|
entropy := ulid.Monotonic(rand.New(rand.NewSource(now.UnixNano())), 0)
|
|
return ulid.MustNew(ulid.Timestamp(now), entropy).String()
|
|
}
|
|
|
|
type GeneralError struct {
|
|
Message string `json:"msg"`
|
|
}
|