Documentation ¶
Index ¶
- type Gen
- type NanoIDGen
- type UUIDGen
- func MonotonicNonZeroID() (UUIDGen, error)
- func SnowFlakeID(dataCenterID, machineID int64, now func() time.Time) (UUIDGen, error)
- func XSnowFlakeID(dataCenterID, machineID int64, now func() time.Time) (UUIDGen, error)
- func XSnowFlakeIDByWorkerID(workerID int64, now func() time.Time) (UUIDGen, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gen ¶
type Gen func() uint64
Gen generates the number uuid.
func StandardSnowFlakeID ¶
The now function is easily to be affected by clock skew. Then the global and unique id is unstable. Deprecated: Please use the SnowFlakeID(datacenterID, machineID int64, now func() time.Time) (UUIDGen, error)
Click to show internal directories.
Click to hide internal directories.