uuid

package
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const JobIDV1 = 1

Variables

This section is empty.

Functions

func ElapsedMilliSecondFromUniqueID

func ElapsedMilliSecondFromUniqueID(s string) (int64, error)

func ExtractDelaySecondFromUniqueID

func ExtractDelaySecondFromUniqueID(s string) (uint32, error)

func ExtractJobIDVersion added in v1.0.15

func ExtractJobIDVersion(s string) int

func GenJobIDWithVersion added in v1.0.15

func GenJobIDWithVersion(version int, delaySecond uint32) string

GenJobIDWithVersion generates a job ID with version prefix and delaySecond. For the legacy version 0 job ID, the version prefix is not included, we use the version prefix to distinguish different job payload format.

Use the last four bytes of the 16-byte's ULID to store the delaySecond. The last fours bytes was some random value in ULID, so changing that value won't affect anything except randomness.

func GenUniqueID

func GenUniqueID() string

Generate Unique ID Currently using ULID, this maybe conflict with other process with very low possibility

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL