Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SafeUnixDiff = time.Second * 10
Functions ¶
func AfterTime ¶
AfterTime uses SafeUnixDiff as factor to make sure we can get an id that is always greater than the given time
func BeforeTime ¶
AfterTime uses SafeUnixDiff as factor to make sure we can get an id that is always less than the given time
func New ¶
New return a Sortable Unique IDentifier IMPORTANT: ksuid is replied on Unix timestamp so the datetime factor is only correct at second level IMPORTANT: that means the order of the ids with same unix timestamps are not guaranteed currently we are using KSUID (https://github.com/segmentio/ksuid) other standard we can consider is UUID v7 (https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-01.html#name-uuidv7-layout-and-bit-order)
Types ¶
This section is empty.